rquery icon indicating copy to clipboard operation
rquery copied to clipboard

Adding child contents to parent text while streaming the document

Open ancamcheachta opened this issue 7 years ago • 4 comments

ancamcheachta avatar Nov 01 '17 22:11 ancamcheachta

hi @ancamcheachta, thanks again for your contribution! This does indeed solve the immediate problem, but as you have highlighted in the issue, this design is pretty memory intensive. I will take a bit more time to consider this PR, code-wise it looks great but I would like to explore other alternatives over the next few days.

yggie avatar Nov 07 '17 18:11 yggie

Thanks @yggie, sounds promising. As a rough and ready solution this change works for me, but yes I'd rather the alternative myself.

I suspect you might keep some variation on this line in new_from_xml_stream, except maybe you don't push the actual value into the text field, but rather some kind of placeholder.

Perhaps then in the text() function you could chain something to children_iter() that formats the text field with the children's own text() values. With any luck that should recursively add the text values of every descendent element.

However you do it, hopefully this test case is adequate to cover.

ancamcheachta avatar Nov 09 '17 09:11 ancamcheachta

Hi guys, I'm considering using rquery as part of my website, has any more thought been put into this?

ghost avatar Sep 08 '18 12:09 ghost

@measlytwerp sorry I haven’t had a look at the issue in a while, this project sort of dropped off my radar as life got busier. Will try to put aside some time this week to look at the issue, is this issue a huge concern for your website?

yggie avatar Sep 10 '18 11:09 yggie