Class DOMUtils


  • public class DOMUtils
    extends Object
    DOM Utilities.
    • Method Detail

      • isXSD

        public static boolean isXSD​(DOMDocument document)
        Returns true if the XML document is a XML Schema and false otherwise.
        Returns:
        true if the XML document is a XML Schema and false otherwise.
      • isXSD

        public static boolean isXSD​(String uri)
        Returns true if the given URI is a XML Schema and false otherwise.
        Parameters:
        uri - the URI to check
        Returns:
        true if the given URI is a XML Schema and false otherwise.
      • isRelaxNG

        public static boolean isRelaxNG​(DOMDocument document)
        Returns true if the XML document is a RelaxNG grammar and false otherwise.
        Returns:
        true if the XML document is a RelaxNG grammar and false otherwise.
      • isRelaxNGXMLSyntax

        public static boolean isRelaxNGXMLSyntax​(DOMDocument document)
        Returns true if the XML document is a RelaxNG grammar XML syntax and false otherwise.
        Returns:
        true if the XML document is a RelaxNG grammar XML syntax and false otherwise.
      • isRelaxNGUriXMLSyntax

        public static boolean isRelaxNGUriXMLSyntax​(String uri)
        Returns true if the given URI is a RelaxNG grammar XML syntax and false otherwise.
        Parameters:
        uri - the URI to check
        Returns:
        true if the given URI is a RelaxNG grammar XML syntax and false otherwise.
      • isRelaxNGUri

        public static boolean isRelaxNGUri​(String uri)
        Returns true if the given URI is a RelaxNG grammar and false otherwise.
        Parameters:
        uri - the URI to check
        Returns:
        true if the given URI is a RelaxNG grammar and false otherwise.
      • isRelaxNGUriCompactSyntax

        public static boolean isRelaxNGUriCompactSyntax​(String uri)
        Returns true if the given URI is a RelaxNG grammar compact syntax and false otherwise.
        Parameters:
        uri - the URI to check
        Returns:
        true if the given URI is a RelaxNG grammar compact syntax and false otherwise.
      • isCatalog

        public static boolean isCatalog​(DOMDocument document)
        Returns true if the XML document is a XML Catalog and false otherwise.
        Returns:
        true if the XML document is a XML Catalog and false otherwise.
      • isDTD

        public static boolean isDTD​(String uri)
        Returns true if the given URI is a DTD and false otherwise.
        Parameters:
        uri - the URI to check
        Returns:
        true if the given URI is a DTD and false otherwise.
      • isXSL

        public static boolean isXSL​(DOMDocument document)
        Returns true if the XML document is a XSL and false otherwise.
        Returns:
        true if the XML document is a XSL and false otherwise.
      • isXSL

        public static boolean isXSL​(String uri)
        Returns true if the given URI is a XSL and false otherwise.
        Parameters:
        uri - the URI to check
        Returns:
        true if the given URI is a XSL and false otherwise.
      • containsTextOnly

        public static boolean containsTextOnly​(DOMElement element)
        Returns true if element contains only DOMText and false otherwise.
        Returns:
        true if element contains only DOMText and false otherwise.
      • loadDocument

        public static DOMDocument loadDocument​(String documentURI,
                                               URIResolverExtensionManager resolverExtensionManager)
        Returns the DOM document from the given XML Schema uri.
        Parameters:
        documentURI - the schema URI
        resolverExtensionManager -
        Returns:
        the DOM document from the given XML Schema uri.
      • findFirstChildElementByTagName

        public static DOMElement findFirstChildElementByTagName​(DOMElement element,
                                                                String tagName)
      • isDOMElement

        public static boolean isDOMElement​(DOMNode node,
                                           String tagName)