Open chludwig-haufe opened 2 years ago
Good catch. The version at https://github.com/w3c/xslt30-test/blob/master/tests/fn/xml-to-json/xml-to-json.xsl is wrong as well. In turn this means that the xslt30-test suite, which claims to test the equivalence of the stylesheet to the native function, must be missing any tests in this area.
The stylesheet is also incorrect in checking for the literal value "true". It needs to trim whitespace, and to accept "1" as equivalent to "true". This is best achieved by changing the predicate to fn:*[xs:boolean(@escaped-key)]
. The same problem affects the tests on @escaped
(e.g. lines 142 and 148).
Hi,
according to the rules described in Sect. 22.1 "XML Representation of JSON" and to the schema in App. B.1 "Schema for the XML Representation of JSON", any element with a
key
attribute may also have an attributeescaped-key
(default valuefalse
).The stylesheet both reproduced in App. B.2 "Stylesheet for converting XML to JSON" and provided as a separate download contains the following templates, though:
They test for the presence and value of the attribute
key-escaped
, notescaped-key
. This is by mistake, isn't it?Cheers, Christoph