On Tue, 2019-09-10 at 02:59 +0200, Andreas Mixich wrote:
> I wonder why the serialization behaves that way. It does not make
> sense to
> me. If a user has the need to escape XML, it should be thorough,
> shouldn't it?

XML entities are expanded by he XML parser, so by the time XQuery (or
XSLT) sees the document they are gone.

Consider an entity like
<!ENTITY boy
"<person><socks>black</socks><eyes>grey</eyes><name>Steven</name></pers
on>">

<students>&boy</students>

It'd be really complex to have that visible to XPath and to have to
write, e.g.
    ..../students/entity(*)/person

If it's an external parsed entity it's visible in that the base-uri
property changes, but that's all.

Character entities like &rcedilla; (ŗ) are just special cases of
general entities, and XML does not distinguish them. I wish it did, but
we never got back to that work after publishing XML 1.0.

Liam

-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Web slave for vintage clipart http://www.fromoldbooks.org/

Reply via email to