Skip to content

Instantly share code, notes, and snippets.

@wendellpiez
Created February 27, 2023 20:52
Show Gist options
  • Select an option

  • Save wendellpiez/da41683ded43d1e61d97faef81891310 to your computer and use it in GitHub Desktop.

Select an option

Save wendellpiez/da41683ded43d1e61d97faef81891310 to your computer and use it in GitHub Desktop.
Command line tests for Saxon

Testing Saxon straight up.

For xslt3 under NPM but should also work with adjustments for Java and other (current/recent) Saxon versions.

Write a number:

xslt3 -xp:"format-integer(164,'Ww')" && echo

Write a date:

xslt3 -xp:"current-date() => format-date('[D] [MNnD3] [Y]')" && echo

JSON inputs to Saxon:

Where t.json is a json file you wish to convert to XPath JSON XML

xslt3 -json:t.json -xp:"serialize(.,map{'method':'json'}) => json-to-xml()" \!indent=yes && echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment