Class DOMDocument

    • Method Detail

      • setCancelChecker

        public void setCancelChecker​(org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
      • getCancelChecker

        public org.eclipse.lsp4j.jsonrpc.CancelChecker getCancelChecker()
      • getElementNameRangeAt

        public org.eclipse.lsp4j.Range getElementNameRangeAt​(int textOffset)
        Returns the element name on the left of the given position and null otherwise.
        Parameters:
        textOffset -
        Returns:
        the element name on the left of the given position and null otherwise.
      • getText

        public String getText()
        Returns the text content of the XML document.
        Returns:
        the text content of the XML document.
      • hasGrammar

        public boolean hasGrammar()
        Returns true if the document is bound to a grammar and false otherwise.
        Returns:
        true if the document is bound to a grammar and false otherwise.
      • getSchemaLocation

        public SchemaLocation getSchemaLocation()
        Returns the declared "xsi:schemaLocation" and null otherwise.
        Returns:
        the declared "xsi:schemaLocation" and null otherwise.
      • hasSchemaLocation

        public boolean hasSchemaLocation()
        Returns true if XML root element declares a "xsi:schemaLocation" and false otherwise.
        Returns:
        true if XML root element declares a "xsi:schemaLocation" and false otherwise.
      • getNoNamespaceSchemaLocation

        public NoNamespaceSchemaLocation getNoNamespaceSchemaLocation()
        Returns the declared "xsi:noNamespaceSchemaLocation" and null otherwise.
        Returns:
        the declared "xsi:noNamespaceSchemaLocation" and null otherwise.
      • hasNoNamespaceSchemaLocation

        public boolean hasNoNamespaceSchemaLocation()
        Returns true if XML root element declares a "xsi:noNamespaceSchemaLocation" and false otherwise.
        Returns:
        true if XML root element declares a "xsi:noNamespaceSchemaLocation" and false otherwise.
      • hasNamespaces

        public boolean hasNamespaces()
        Returns true if document defines namespaces (with xmlns) and false otherwise.
        Returns:
        true if document defines namespaces (with xmlns) and false otherwise.
      • getSchemaInstancePrefix

        public String getSchemaInstancePrefix()
        Returns the (xsi) schema instance prefix and null otherwise.
        Returns:
        the (xsi) schema instance prefix and null otherwise.
      • hasSchemaInstancePrefix

        public boolean hasSchemaInstancePrefix()
        Returns true if (xsi) schema instance prefix exists.
        Returns:
        true if (xsi) schema instance prefix exists.
      • hasProlog

        public boolean hasProlog()
        If document has <?xml ... ?>
        Returns:
      • getProlog

        public DOMNode getProlog()
        If document has <?xml ... ?>, return this prolog, null otherwise
        Returns:
        prolog DOMNode, if the document has one, null otherwise
      • isBeforeProlog

        public boolean isBeforeProlog​(int offset)
        Returns true, if the given offset is before XML declaration (<?xml ...?>), false otherwise.
        Parameters:
        offset - the offset position in question
        Returns:
        true, if before xml declaration; false otherwise
      • hasDTD

        public boolean hasDTD()
        Returns true if XML document has a DTD declaration and false otherwise.
        Returns:
        true if XML document has a DTD declaration and false otherwise.
      • hasXMLModel

        public boolean hasXMLModel()
        Returns true if XML document has a xml-model processing declaration and false otherwise.
        Returns:
        true if XML document has a xml-model processing declaration and false otherwise.
      • getXMLModels

        public List<XMLModel> getXMLModels()
        Returns the list of xml-model processing instruction declared in the document.
        Returns:
        the list of xml-model processing instruction declared in the document.
      • hasExternalGrammar

        public boolean hasExternalGrammar()
        Returns true if the document is bound to an external grammar (XML file associations, XLM catalog) and false otherwise.
        Returns:
        true if the document is bound to an external grammar (XML file associations, XLM catalog) and false otherwise.
      • getExternalGrammarLocation

        public Map<String,​String> getExternalGrammarLocation()
        Returns the external grammar location (XSD, DTD from xml file associations) and null otherwise.
        Returns:
        the external grammar location (XSD, DTD from xml file associations) and null otherwise.
      • getExternalGrammarFromNamespaceURI

        public String getExternalGrammarFromNamespaceURI()
        Returns the grammar location found by the namespace URI from the document root element (ex : found with XML catalog) and null otherwise.
        Returns:
        the grammar location found by the namespace URI from the document root element (ex : found with XML catalog) and null otherwise.
      • createElement

        public DOMElement createElement​(int start,
                                        int end)
      • createCDataSection

        public DOMCDATASection createCDataSection​(int start,
                                                  int end)
      • createComment

        public DOMComment createComment​(int start,
                                        int end)
      • createText

        public DOMText createText​(int start,
                                  int end)
      • createDocumentType

        public DOMDocumentType createDocumentType​(int start,
                                                  int end)
      • getNodeType

        public short getNodeType()
        Specified by:
        getNodeType in interface Node
      • setStrictErrorChecking

        public void setStrictErrorChecking​(boolean strictErrorChecking)
        Specified by:
        setStrictErrorChecking in interface Document
      • resetGrammar

        public void resetGrammar()
        Reset the cached grammar flag.
      • isDTD

        public boolean isDTD()
        Returns true if the XML document is a DTD and false otherwise.
        Returns:
        true if the XML document is a DTD and false otherwise.
      • isWithinInternalDTD

        public boolean isWithinInternalDTD​(int offset)
        Returns true if 'offset' is within an internal DOCTYPE dtd. Else false.
        Parameters:
        offset -
        Returns:
      • getTrimmedRange

        public org.eclipse.lsp4j.Range getTrimmedRange​(org.eclipse.lsp4j.Range range)
      • getTrimmedRange

        public org.eclipse.lsp4j.Range getTrimmedRange​(int start,
                                                       int end)
      • findDTDAttrList

        public Collection<DOMNode> findDTDAttrList​(String elementName)
        Returns the DTD Attribute list for the given element name and empty otherwise.
        Parameters:
        elementName -
        Returns:
        the DTD Attribute list for the given element name and empty otherwise.
      • getSchemaPrefix

        public String getSchemaPrefix()
        Returns the XML Schema prefix (ex : 'xs' for xmlns:xs="http://www.w3.org/2001/XMLSchema")
        Returns:
        the XML Schema prefix (ex : 'xs' for xmlns:xs="http://www.w3.org/2001/XMLSchema")