This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Some tests (K2-ComputeConAttr-58) where the implementation invents a namespace prefix have ignore-prefixes="true" in the <assert-xml> elements, others (K2-ComputeConAttr-51, K2-ComputeConAttr-53) do not. catalog-schema.html does not say what the point of the ignore-prefixes attribute is, but it does say that the documents can be compared by deep-equal, which would make the attribute pointless, since deep-equal always ignores the prefixes.
The attribute is documented in catalog-schema.xsd: <xs:attribute name="ignore-prefixes" type="xs:boolean"> <xs:annotation> <xs:documentation> <p>If this attribute is present with the value "true", it indicates that the serialized result contains system-generated prefixes which can lead to ignorable differences between the actual result and the serialized result.</p> <p>This attribute is rarely used, and should be avoided for new tests. Instead, the test result should be expressed using assertions that take no account of the namespace prefixes generated.</p> </xs:documentation> </xs:annotation> </xs:attribute>
Thanks Benito. The Working Group discussed this on 2015-02-10 and decided that the tests should stay as is. The catalog-schema.html will be re-generated from the xsd in order to fix the second part of this.
>The Working Group discussed this on 2015-02-10 and decided that the tests should stay as is. Which tests? Why? Just too much trouble to update? K2-ComputeConAttr-51, K2-ComputeConAttr-53 have implementation defined prefixes, so if there is any point to ignore-prefixes, they need it >The catalog-schema.html will be re-generated from the xsd in order to fix the second part of this. catalog-schema.html still does not have the documentation for ignore-prefixes. Does the generation just ignore the documentation of attributes ? This is still very unclear, even with the documentation from the xsd instead the html. It says the comparison can either be done with canonicalization ("it is possible to prove that namespace rewriting is harmful") or fn:deep-equal, but they treat namespaces prefixes differently
The WG asked me to reply (again). I think the situation can be summarised as follows: * Test authors should avoid using assert-xml for new tests if the result tree contains implementation-defined namespace prefixes. * There may be some existing tests that use assert-xml even though the result contains implementation-defined prefixes; the presence of the attribute ignore-prefixes="true" alerts the reader (or test driver software) to the fact that this is the case. Other attributes that may appear are normalize-space and xml-version. * Generally, for new tests, XPath-based assertions are preferred, because they can distinguish more precisely what aspects of the result are essential to the success of the test. * XML canonicalization can be used to implement the assert-xml assertion except in cases where ignore-prefixes is set; in such cases the test driver must find some way of comparing the results in such a way that prefixes are not considered significant. * Using deep-equal() is not really strong enough to implement assert-xml properly, although it's probably good enough for most cases; but, for example, it ignores comments and processing instructions. (In the Saxon test driver, we use saxon:deep-equal() to implement assert-xml. This is a variant of fn:deep-equal() that allows customization of the equality comparison. For example, we set options to ensure that namespace declarations, comments, and processing instructions are not ignored; we set a flag to ignore namespace prefixes if and only if the ignore-prefixes attribute is set to "true").
I have fixed the two tests K2-ComputeConAttr-51, K2-ComputeConAttr-53 by replacing the assert-xml with XPath assertions.