Class JsonToXMLFn

All Implemented Interfaces:
Callable, IFunctionWithRetainedParameterNames, 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

    • RESULT_TYPE

      public static ItemType RESULT_TYPE
  • Constructor Details

    • JsonToXMLFn

      public JsonToXMLFn()
  • Method Details

    • makeOptionsParameter

      public static OptionsParameter makeOptionsParameter(int version)
    • decodeBinary

      public static StringValue decodeBinary(XPathContext context, byte[] binaryValue) throws XPathException, IOException
      Throws:
      XPathException
      IOException
    • 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(UnicodeString 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