2

Did anyone get successful to use this command line sample? with a hardcoded json string as below command from this link posted by Michael Kay (founder of Saxonica):

java -cp Saxon-HE-9.7.0-18.jar net.sf.saxon.Query -t -qs:"json-to-xml('{\"x\":1}')" -o:output:some.xml

I continuously got follow error with even PE/EE:

  • Saxon-HE 9.7.0.18J from Saxonica
  • Java version 1.7.0_79 Analyzing query from {json-to-xml('{"x":1}')}
  • Static error on line 1 at column 1 in {json-to-xml('{"x":1}')}
  • XPST0017: System function json-to-xml#1 is not available with this host-language/version/license Static error(s) in query

Can anyone help?

1 Answer 1

2

I was able to successfully use the example by specifying the version "3.1" (-qversion:3.1) on the command line:

C:\Windows\System32>java -cp "C:/apps/saxon/saxon9he.jar" net.sf.saxon.Query -t -qversion:3.1 -qs:"json-to-xml('{\"x\":1}')"
Saxon-HE 9.7.0.8J from Saxonica
Java version 1.8.0_60
Analyzing query from {json-to-xml('{"x":1}')}
Analysis time: 117.919941 milliseconds
<?xml version="1.0" encoding="UTF-8"?><map xmlns="http://www.w3.org/2005/xpath-functions"><number key="x">1</number></map>
Execution time: 40.174138ms
Memory used: 29834272
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks Daniel! that's the tricky. Not sure why this is not documented in their website.
my bad; since I am doing a quick POC, I did not go over the document thoroughly so that I missed so important info in the document;
@MichaelSun - It's no problem. Glad I could help. I'd still appreciate you accepting the answer by clicking on the check mark (✅) next to it. :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.