This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I think the test should be <test><![CDATA[parse-xml("<!DOCTYPE a [<!ELEMENT a (#PCDATA)><!ENTITY foo SYSTEM 'parse-xml/foo.entity'>]><a>&foo;</a>")]]></test> in <test-case name="parse-xml-010"> <description>parse-xml test - with external entity</description> <created by="Michael Kay" on="2013-01-07"/> <environment name="empty"/> <test><![CDATA[parse-xml("<!DOCTYPE a [<!ELEMENT a (#PCDATA)><!ENTITY foo SYSTEM 'parse-xml/foo.entity'>]><a>&foo;</a>")]]></test> <result> <assert-xml><![CDATA[<a><bar>baz</bar></a>]]></assert-xml> </result> </test-case> to match the intent of the test.
I think it depends on whether you run it using an XPath processor or an XQuery processor. The expression is this: parse-xml("<!DOCTYPE a [<!ELEMENT a (#PCDATA)><!ENTITY foo SYSTEM 'parse-xml/foo.entity'>]><a>&foo;</a>") In XQuery, the query processor interprets "&" in the string literal as &, so it passes &foo; to the XML parser. In XPath, the xpath processor does nothing to the string, so it passes "&foo;" to the XML parser. Do you agree with that analysis? If so, it looks like we need to split it into different tests for XPath and XQuery. Alternatively, we can construct the XML string using string concatenation and codepoints-to-string().
> Do you agree with that analysis? Yes. I hadn't spotted that it was only failing for XP30 runs, and not XQ30.
Fixed by using codepoint-to-string() for the ampersand.