Class JsonToXMLFn

All Implemented Interfaces:
Callable, FunctionItem, GroundedValue, Item, Sequence
Direct Known Subclasses:
ParseJsonFn

public class JsonToXMLFn extends SystemFunction
Implements the json-to-xml function defined in XSLT 3.0.
  • Field Details

  • Constructor Details

    • JsonToXMLFn

      public JsonToXMLFn()
  • Method Details

    • call

      public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException
      Evaluate the expression
      Parameters:
      context - the dynamic evaluation context
      arguments - the values of the arguments, supplied as SequenceIterators
      Returns:
      the result of the evaluation, in the form of a SequenceIterator
      Throws:
      XPathException - if a dynamic error occurs during the evaluation of the expression
    • eval

      protected Item eval(String input, MapItem options, XPathContext context) throws XPathException
      Parse the JSON string according to supplied options
      Parameters:
      input - JSON input string
      options - options for the conversion as a map of xs:string : value pairs
      context - XPath evaluation context
      Returns:
      the result of the parsing, as an XML element
      Throws:
      XPathException - if the syntax of the input is incorrect