Bug ID: 25196
Summary: Availability of the xml-to-json packages
Product: XPath / XQuery / XSLT
Version: Last Call drafts
OS: Windows NT
Component: XSLT 3.0
Assignee: [hidden email] Reporter: [hidden email] QA Contact: [hidden email]
Under , the section on XML To JSON, we do not currently mandate that the
packages in B.2 have to be made available by implementers. I suggest we add a
line something like the following:
An implementation must make the packages under B.2 available through their
name, 'http://www.w3.org/2013/XSLT/xml-to-json.xsl', whether or not the package
is also physically available (i.e. for editing) is implementation defined.
In addition, I noted the following minor issues:
1) the stylesheet under B.3  uses xsl:import on a package with a relative
url. We have decided in the resolution for bug 24310 that packages cannot be
2) the stylesheet under B.3 is not a package, which limits its usefulness and
does not make it readily available.
3) the stylesheet under B.3 does not re-use / redefine $j:start-map.
4) $indent-spaces should probably be $j:indent-spaces
We can solve (1) and (2) easily by embedding the stylesheet under B.3 inside
the package under B.2, with a default parameter for $indent-spaces of "0". In
addition, we can add a boolean, $j:indent, which, if set, changes the value of
other separators to include more whitespace (see for instance template
We can solve (3) by rewriting $j:start-map dependent on the new $j:indent value
to include spacing.
Solving all these issues adds usability. We could simplify using the indented
version further by adding a function f:xml-to-json-indented, which calls the
overridden version of the templates (which will require a bit of redesigning of
the global parameters, allowing them to be overridden by function call and/or
See also bug 25187, which mentions a few other (static) bugs in the stylesheets
in this section.
What |Removed |Added
--- Comment #3 from Michael Kay <[hidden email]> ---
The WG was generally happy with the text that appears in the current editor's
draft. But there was a feeling that the xml-to-json stylesheet should be a
package, and that we should require implementations to support xsl:use-package
specifying the relevant package name.
This in turn led to a discussion about the use of static variables in packages.
This stylesheet uses two static parameters INDENT and VALIDATION, and these
parameters need to be supplied at package compile time. As a result, there will
be multiple versions of the "compiled package" with different settings for
these parameters. One would expect an xsl:use-package declaration to be able to
say which of these versions it wants. (Perhaps this is out of scope for the
spec and simply implies an indirection between the name of the source package
and the name of a compiled package?)
Resolved to close this as resolved, but with an action to look at converting
the stylesheet to a package.
You are receiving this mail because:
You are the QA Contact for the bug.