Package org.eclipse.lemminx.utils
Class DOMUtils
java.lang.Object
org.eclipse.lemminx.utils.DOMUtils
DOM Utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsTextOnly(DOMElement element) Returns true if element contains only DOMText and false otherwise.static InputSourcecreateInputSource(DOMDocument document) static DOMElementfindFirstChildElementByTagName(DOMElement element, String tagName) static booleanisCatalog(DOMDocument document) Returns true if the XML document is a XML Catalog and false otherwise.static booleanisDOMElement(DOMNode node, String tagName) static booleanReturns true if the given URI is a DTD and false otherwise.static booleanisRelaxNG(DOMDocument document) Returns true if the XML document is a RelaxNG grammar and false otherwise.static booleanisRelaxNGUri(String uri) Returns true if the given URI is a RelaxNG grammar and false otherwise.static booleanReturns true if the given URI is a RelaxNG grammar compact syntax and false otherwise.static booleanReturns true if the given URI is a RelaxNG grammar XML syntax and false otherwise.static booleanisRelaxNGXMLSyntax(DOMDocument document) Returns true if the XML document is a RelaxNG grammar XML syntax and false otherwise.static booleanReturns true if the given URI is a XML Schema and false otherwise.static booleanisXSD(DOMDocument document) Returns true if the XML document is a XML Schema and false otherwise.static DOMDocumentloadDocument(String documentURI, URIResolverExtensionManager resolverExtensionManager) Returns the DOM document from the given XML Schema uri.static SAXParserFactoryReturns an instance of SAX parser factory by disabling external entities declarations.
-
Method Details
-
isXSD
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
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
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
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
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
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
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
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
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.
-
containsTextOnly
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 URIresolverExtensionManager-- Returns:
- the DOM document from the given XML Schema uri.
-
newSAXParserFactory
public static SAXParserFactory newSAXParserFactory() throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationExceptionReturns an instance of SAX parser factory by disabling external entities declarations.- Returns:
- an instance of SAX parser factory by disabling external entities declarations.
- Throws:
SAXNotRecognizedExceptionSAXNotSupportedExceptionParserConfigurationException
-
findFirstChildElementByTagName
-
isDOMElement
-
createInputSource
-