Re: [xml-dev] How can the content of a leaf element be multiple text nodes?

From
Michael Kay <>
To
Roger L Costello <>
Date
2022-02-12T08:34:21Z
ID
<>
Thread
Re: [xml-dev] How can the content of a leaf element be multiple text nodes?
> 
> Lastly, how many text nodes are within this <Test> element?
> 
> <Test>abc&amp;def</Test>
> 
> Answer: 1
> 
> Interesting!
> 
> So, what is the text? 
> 
> Is it this: abc&def (i.e., the entity is resolved)?
> 
> No! 
> 
> The text is this: abc&amp;def (the entity is *not* resolved)
> 

The content of the text node is the 7-character string "abc&def".

It might be displayed as "abc&amp;def" if you're displaying it using XML serialization. You need to distinguish the content of the text node from its visual representation. The XPath spec doesn't say anything about the visual representation.

Michael Kay
Saxonica