XML: what processing rules apply for tagged values?

I started working on a simple XML parser, and since I just relaxed my opinion about correct XML syntax regarding certain characters / sequences, ignorant spaces and such (thanks, http://www.w3schools.com/xml/xml_elements.asp ), I realized I still don't know squats about what can be described as the following case (which Validome finds very well, please note that I only want to use xml files to store data, no entities, DTDs or schemas needed) :

<bookstore>
   <book id="1">
      <author>Kurt Vonnegut Jr.</author>
      <title>Slapstick</title>
   </book>
We drop a pie here.
   <book id="2">Who cares anyway?
      <author>Stephen King</author>
      <title>The Green Mile</title>
   </book>
And another one here.
   <book id="3">
      <author>Next one</author>
      <title>This time with its own title</title>
   </book>
</bookstore>

      

"We're throwing pie here." and "And one more here." are the values โ€‹โ€‹of the bookstore element. "Who cares?" this is the value associated with the second "book" item.

How are they handled, if at all? "We'll throw the pie here." and "One more here". be combined to form a single value for a bookstore item, or are they processed separately, stored somewhere, affecting the result of parsing the item to which they belong, or ...?

0


a source to share


1 answer


The easiest way is to parse it with several standards compliant parsers and dump the output.



0


a source







All Articles