Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML element structure Q.

From: richard@------.--.--.-- (------- -----)
To: NULL
Date: 2/2/2009 11:52:00 AM
In article <pan.2009.01.30.23.41.47.185358@r...>,
Jules  <jules.richardsonnews@r...> wrote:

>Fair enough - but from a parser point of view, what's the correct
>behaviour if multiple blocks of text are found amongst multiple "sub
>elements"? Should the parser somehow concatenate the blocks and present a
>single text string at the API layer? Or should it present multiple blocks
>as individual strings?

Concatenating the immediate text children would almost never be the
right thing.  Mixed content is rarely used in data-oriented XML, but
is very common in traditional text markup (such as XHTML).  Typically
the child elements will contain further text, for example

  This is <em>important</em>.

so concatenating the child text would give you "This is." which
is not likely to be useful.

Concatenating all the text descendants makes more sense - in this case
it would give you "This is important." - but in effect you are
stripping out the markup, so it's unlikely to be the main use of
the document.

-- Richard
-- 
Please remember to mention me / in tapes you leave behind.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent