Class NodeUtils


  • public class NodeUtils
    extends Object
    • Field Detail

      • collectionResolverSymbol

        public static final Symbol collectionResolverSymbol
        Symbol used to bind a collection resolver.
    • Constructor Detail

      • NodeUtils

        public NodeUtils()
    • Method Detail

      • localName

        public static String localName​(Object node)
      • namespaceURI

        public static Object namespaceURI​(Object node)
      • prefixesFromNodetype

        public static void prefixesFromNodetype​(XName name,
                                                Consumer out)
      • inScopePrefixes$X

        public static void inScopePrefixes$X​(Object node,
                                             CallContext ctx)
      • root

        public static Object root​(Object arg)
        Return the root node of the argument.
      • rootDocument

        public static KDocument rootDocument​(Object arg)
        Return root node, coerced to a document node. Used to implement '/'-rooted path expressions.
      • getLang

        public static String getLang​(KNode node)
      • lang

        public static boolean lang​(Object testlang,
                                   Object node)
      • documentUri

        public static Object documentUri​(Object arg)
      • setSavedCollection

        public static void setSavedCollection​(Object uri,
                                              Object value,
                                              Environment env)
        Add a uri-to-value binding that setSavedCollection can later return.
      • setSavedCollection

        public static void setSavedCollection​(Object uri,
                                              Object value)
        Add a uri-to-value binding that setSavedCollection can later return.
      • getSavedCollection

        public static Object getSavedCollection​(Object uri,
                                                Environment env)
        Default resolver for fn:collection. Return nodes previously bound using setSavedCollection.
      • getSavedCollection

        public static Object getSavedCollection​(Object uri)
        Default resolver for fn:collection. Return nodes previously bound using setSavedCollection.
      • docCached

        public static Object docCached​(Object uri,
                                       Object base)
                                throws Throwable
        Parse an XML document, caching the result. Only positive results are cached; failures are not.) This implements the standard XQuery fn:doc function.
        Throws:
        Throwable
      • availableCached

        public static boolean availableCached​(Object uri,
                                              Object base)
                                       throws Throwable
        Check if an XML document is available, caching the result. Only positive results are cached; failures are not. Thus it is possible for a false result to be followed by a true result, but not vice versa. This implements the standard XQuery fn:doc-available function.
        Throws:
        Throwable