0

This is the response:

{"jwt":"eyJhbGc....."}

The scheduler we use can use an XSLT stylesheet and I want to extract the value of "jwt" only as output, to use in a subsequent job.

I saw another post about using fn:parse-json():

How to extract data from JSON in XSLT?

But there is limited info for someone that has never...EVER worked with XSLT.

Edit:

The documentation for the web service caller, does not give specifics on what version of XSLT it supports. That json object is also all it is...just on string with the name "jwt".

user3377627
  • 363
  • 3
  • 7
  • 22
  • 2
    The biggest thing to realize about XPath: a lot of features are only supported by XSLT 3, which nobody uses since it only has Java implementations AFAICT. However, if you're libxml2 version of XSLT, some of the features (but not JSON) are supported in the `exslt` namespace. – o11c Oct 18 '21 at 20:41
  • Is that the entire JSON? A single object holding a single name/value pair, with the name known in advance?? – michael.hor257k Oct 18 '21 at 20:44
  • 1
    P.S. In all your questions regarding XSLT, please state which version of XSLT your processor supports. If you're not sure, see here how to find out: https://stackoverflow.com/a/25245033/3016153 – michael.hor257k Oct 18 '21 at 20:49
  • *"The documentation for the web service caller, does not give specifics on what version of XSLT it supports."* Please follow the instructions in the link above to identify the processor. As mentioned above you need a processor that supports XSLT 3.0 in order tp parse JSON as JSON. Otherwise you will need to parse it as string which is NOT the optimal way to handle JSON. --- Also we need to see an example of the entire XML containing the JSON string (I am assuming it is contained in an XML, otherwise I am not sure how you intend to pass it to the XSLT processor). – michael.hor257k Oct 19 '21 at 03:34
  • @o11c "Nobody" is an exaggeration. Saxon has thousands of downloads every week. It's also available on platforms other than Java, including .NET and node.js. What you meant to say, I think, is that there are large numbers of people who are still stuck on earlier XSLT versions. – Michael Kay Oct 19 '21 at 07:52

0 Answers0