StaxMate icon indicating copy to clipboard operation
StaxMate copied to clipboard

Add a convenience method for reading "all text values of all child elements"

Open cowtowncoder opened this issue 11 years ago • 0 comments

A relatively common case seems to be that of mapping structures like, say:

<root>
  <elem1>text</elem1>
  ...
 <elemN>textN</elemN>
</root>

Iterating over this structure is not super hard, but it would be nice to just have a method for "reading it all in", to produce map like:

{ "elem1" : "text", ... , "elemN" : "textN" }

and then let caller do whatever it needs to. Textual content should probably be simple collected with 'collectDescendantText', to work even if sub-elements were included.

cowtowncoder avatar Feb 28 '13 21:02 cowtowncoder