Is there a way to use json-to-xml($json, map { 'validate': true() }) from the command line with Saxon 9.7 EE?
Added by Martin Honnen about 8 years ago
If I understand https://www.w3.org/XML/Group/qtspecs/specifications/xslt-30/html/#func-json-to-xml correctly then the @json-to-xml@ function with a schema-aware processor like Saxon 9.7 EE should allow"that the resulting XDM instance must be typed", however when trying that with 9.7 from the command line it seems to look for two schemas @analyze-string.xsd@ and @json.xsd@ in the current directory which it does not find.
A sample I tried is
{ "date": "2016-11-05T00:00:00", "valid" : true }
and run it from the command line with @ -xsl:test201611050101.xsl -it:main -t -sa@ the output is
Saxon-EE 9.7.0.10J from Saxonica Loading a schema from resources for: http://www.w3.org/2005/xpath-functions Loading schema document null URIResolver.resolve href="analyze-string.xsd" base="" Loading schema document file:/C:/SomePath/analyze-string.xsd Warning at xs:include on line 14 column 54 Included schema document analyze-string.xsd cannot be located: java.io.FileNotFoundException (C:\SomePath\analyze-string.xsd (Das System kann die angegebene Datei nicht finden)) URIResolver.resolve href="json.xsd" base="" Loading schema document file:/C:/SomePath/json.xsd Warning at xs:include on line 15 column 44 Included schema document json.xsd cannot be located: java.io.FileNotFoundException (C:\SomePath\json.xsd (Das System kann die angegebene Datei nicht finden)) Finished loading schema document null 2016-11-05T 00:00:00truefalse
Is there any way to use schema-aware @json-to-xml@ with the current Saxon 9.7 release?
Replies (1)
RE: Is there a way to use json-to-xml($json, map { 'validate': true() }) from the command line with Saxon 9.7 EE? - Added by Michael Kay about 8 years ago
As it happens I stumbled across this myself a couple of days ago and raised an issue here:
https://saxonica.plan.io/issues/3017
which I have fixed for the development branch but not yet for 9.7. While working on it I also found a deficiency in the W3C-published schema and I decided to wait until that is resolved one way or another.
Please register to reply