I have a sequence of strings that I need to parse as XML using XSLT. For example:
<span>Foo</span> & <span>bar</span> have been tagged.
When I try to parse this using fn:parse-xml-fragment (using Saxon-PE 9.6.0.5), two errors are thrown:
- The entity name must immediately follow the '&' in the entity reference.
- FODC0006: First argument to parse-xml-fragment() is not a well-formed and namespace-well-formed XML fragment.
If I remove the &
entity from the input text, then it parses correctly. However, if the entity is escaped in the input, why would it cause XML parsing to fail?