This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The documentation of `<assert-xml>` says: > Asserts the result of the query by providing a serialization of the expression > result using the default serialization parameters method="xml" indent="no" > omit-xml-declaration="yes". As the file "app/Demos/currencysvg-result.xml" has an XML declaration, I don't think the test case "currencysvg" can succeed: > <test-case name="currencysvg"> > [...] > <test file="Demos/currencysvg.xq"/> > <result> > <assert-xml file="Demos/currencysvg-result.xml"/> > </result> > </test-case>
You're correct that the test isn't following the authoring guidelines. However, this shouldn't cause the test to fail. The documentation also states (on the "running tests" page): The assert-xml assertion succeeds if the result is an XML document that compares deep-equal to the document contained (in XML form) in the assertion. And it also says (in the schema documentation): The assertion is true if the result of parsing and canonicalizing the XML given in the body of the assert-xml element is the same (byte-for-byte) as the result of canonicalizing the XML result of the query. Clearly the presence of the XML declaration does not affect the comparison if it is done according to these rules. Assert-xml should not be interpreted as a comparison of serialized results; the schema comments make this clear.
Correct, I misinterpreted the part saying: > The value will not necessarily be a well-formed document (it may be a fragment). > The comparison can be done by converting the string into a well-formed > document by adding a wrapper element. Doing this textually yields invalid XML if an XML declaration is present.
(In reply to comment #2) > Correct, I misinterpreted the part saying: > > > The value will not necessarily be a well-formed document (it may be a fragment). > > The comparison can be done by converting the string into a well-formed > > document by adding a wrapper element. > > Doing this textually yields invalid XML if an XML declaration is present. No it does not. An XML declaration is optional and if included does not count towards the well-formedness of an XML document.
I agree with Leo that the XML declaration should be removed in this test. First, the resulting XML will indeed be invalid if the string with the XML declaration is converted "into a well-formed document by adding a wrapper element.", as proposed in the documentation. Second, it seems to be the only test case that does not follow the authoring guidelines, so it’s probably less effort than aligning the documentation.
I withdraw my comment in #3. If we all agree I will will remove the XML declaration
That would be great.
Bug fixed and committed to cvs