Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XML element structure Q. [Thread Next] Re: XML element structure Q.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. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
