Class QNameUtils


  • public class QNameUtils
    extends Object
    • Constructor Detail

      • QNameUtils

        public QNameUtils()
    • Method Detail

      • resolveQNameUsingElement

        public static Object resolveQNameUsingElement​(Object qname,
                                                      KElement node)
      • resolveQName

        public static Object resolveQName​(Object qname,
                                          NamespaceBinding constructorNamespaces,
                                          NamespaceBinding prologNamespaces)
        Method called from compiled code to "cast" to a QName.
        Parameters:
        qname - The value to cast to QName.
        constructorNamespaces - Namespace bindings from namespace attributes in direct element constructors.
        prologNamespaces - Namespac bindings from query prolog, as well as builtin namespace prefixes.
      • lookupPrefix

        public static String lookupPrefix​(String prefix,
                                          NamespaceBinding constructorNamespaces,
                                          NamespaceBinding prologNamespaces)
        Search for a uri matching the given prefix.
        Returns:
        uri or null if there is no binding for prefix.
      • resolvePrefix

        public static String resolvePrefix​(String prefix,
                                           NamespaceBinding constructorNamespaces,
                                           NamespaceBinding prologNamespaces)
        Search for a uri matching the given prefix. Throw exception if there is no binding and the prefix is non-empty.
      • validNCName

        public static boolean validNCName​(String name)
      • makeQName

        public static Symbol makeQName​(Object paramURI,
                                       String paramQName)
        This implements the fn:QName standard function.
      • localNameFromQName

        public static Object localNameFromQName​(Object name)
      • prefixFromQName

        public static Object prefixFromQName​(Object name)
      • namespaceURIFromQName

        public static Object namespaceURIFromQName​(Object name)
      • namespaceURIForPrefix

        public static Object namespaceURIForPrefix​(Object prefix,
                                                   Object element)