This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29790 - [xslt30] Sample stylesheet for xml-to-json conversion uses a reserved namespace
Summary: [xslt30] Sample stylesheet for xml-to-json conversion uses a reserved namespace
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 minor
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-23 20:57 UTC by Michael Kay
Modified: 2017-01-12 21:44 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2016-08-23 20:57:30 UTC
At some stage we changed the namespace used for elements in the "xml representation of JSON" schema to use the standard F+O namespace. We then changed the stylesheet for xml-to-json transformation accordingly. A consequence of this change is that the stylesheet now has used-defined functions in the F+O namespace, which is not allowed (the namespace is reserved).

Also the following sentence in the spec (ยง22.4) is no longer true: 

This stylesheet includes a function j:xml-to-json which, apart from being in a different namespace, is functionally identical to the xml-to-json function described in the previous section.

The j:xml-to-json namespace is currently in the same namespace as the standard fn:xml-to-json function.
Comment 1 Michael Kay 2016-09-09 22:04:57 UTC
Reclassified as editorial.

I have made the changes needed to the stylesheet.

But leaving the bug open until the revised version is tested.
Comment 2 Michael Kay 2016-10-06 12:34:20 UTC
I have been testing the revised stylesheet and came across a few issues, not all directly related to the stylesheet itself.

The function entry points to the stylesheet should be declared as streamable stylesheet functions with streamability="absorbing".

To test streamable use of the stylesheet I wanted to compare the results with streamed application of fn:xml-to-json() and I found that we had no tests for this, and it wasn't implemented in Saxon. So I've been developing tests (and an implementation that passes them) for fn:xml-to-json() and will come back to the stylesheet when that work is complete.
Comment 3 Michael Kay 2017-01-12 00:23:13 UTC
I have now adapted the test set for fn:xml-to-json so the same tests are run with both the built-in function an the XSLT stylesheet, and both appear to give the same results, so I am now happy to close this bug.