DTD_ATT_LIST_NODE, DTD_DECL_NODE, DTD_ELEMENT_DECL_NODE, DTD_ENTITY_DECL_NODE, DTD_NOTATION_DECL, NULL_VALUE
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
DOMDocument(TextDocument textDocument,
URIResolverExtensionManager resolverExtensionManager) |
Modifier and Type | Method and Description |
---|---|
DOMNode |
adoptNode(Node source) |
DOMAttr |
createAttribute(String name) |
DOMAttr |
createAttributeNS(String namespaceURI,
String qualifiedName) |
DOMCDATASection |
createCDataSection(int start,
int end) |
CDATASection |
createCDATASection(String data) |
DOMComment |
createComment(int start,
int end) |
DOMComment |
createComment(String data) |
DocumentFragment |
createDocumentFragment() |
DOMDocumentType |
createDocumentType(int start,
int end) |
DOMElement |
createElement(int start,
int end) |
DOMElement |
createElement(String tagName) |
DOMElement |
createElementNS(String namespaceURI,
String qualifiedName) |
EntityReference |
createEntityReference(String name) |
DOMProcessingInstruction |
createProcessingInstruction(int start,
int end) |
DOMProcessingInstruction |
createProcessingInstruction(String target,
String data) |
DOMText |
createText(int start,
int end) |
DOMText |
createTextNode(String data) |
Collection<DOMNode> |
findDTDAttrList(String elementName)
Returns the DTD Attribute list for the given element name and empty
otherwise.
|
org.eclipse.lsp4j.jsonrpc.CancelChecker |
getCancelChecker() |
DOMDocumentType |
getDoctype() |
DOMElement |
getDocumentElement() |
String |
getDocumentURI() |
DOMConfiguration |
getDomConfig() |
DOMElement |
getElementById(String elementId) |
org.eclipse.lsp4j.Range |
getElementNameRangeAt(int textOffset)
Returns the element name on the left of the given position and null
otherwise.
|
NodeList |
getElementsByTagName(String tagname) |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName) |
String |
getExternalGrammarFromNamespaceURI()
Returns the grammar location found by the namespace URI from the document
root element (ex : found with XML catalog) and null otherwise.
|
Map<String,String> |
getExternalGrammarLocation()
Returns the external grammar location (XSD, DTD from xml file associations)
and null otherwise.
|
DOMImplementation |
getImplementation() |
String |
getInputEncoding() |
LineIndentInfo |
getLineIndentInfo(int lineNumber) |
String |
getNamespaceURI() |
String |
getNodeName() |
short |
getNodeType() |
NoNamespaceSchemaLocation |
getNoNamespaceSchemaLocation()
Returns the declared "xsi:noNamespaceSchemaLocation" and null otherwise.
|
DOMDocument |
getOwnerDocument()
Returns the owner document and null otherwise.
|
DOMNode |
getProlog()
If document has {@code
|
URIResolverExtensionManager |
getResolverExtensionManager() |
List<DOMNode> |
getRoots() |
String |
getSchemaInstancePrefix()
Returns the (xsi) schema instance prefix and null otherwise.
|
SchemaLocation |
getSchemaLocation()
Returns the declared "xsi:schemaLocation" and null otherwise.
|
String |
getSchemaPrefix()
Returns the XML Schema prefix (ex : 'xs' for
xmlns:xs="http://www.w3.org/2001/XMLSchema")
|
boolean |
getStrictErrorChecking() |
String |
getText()
Returns the text content of the XML document.
|
TextDocument |
getTextDocument() |
org.eclipse.lsp4j.Range |
getTrimmedRange(int start,
int end) |
org.eclipse.lsp4j.Range |
getTrimmedRange(org.eclipse.lsp4j.Range range) |
String |
getXmlEncoding() |
List<XMLModel> |
getXMLModels()
Returns the list of xml-model processing instruction declared in the
document.
|
boolean |
getXmlStandalone() |
String |
getXmlVersion() |
boolean |
hasDTD()
Returns true if XML document has a DTD declaration and false otherwise.
|
boolean |
hasExternalGrammar()
Returns true if the document is bound to an external grammar (XML file
associations, XLM catalog) and false otherwise.
|
boolean |
hasGrammar()
Returns true if the document is bound to a grammar and false otherwise.
|
boolean |
hasNamespaces()
Returns true if document defines namespaces (with xmlns) and false otherwise.
|
boolean |
hasNoNamespaceSchemaLocation()
Returns true if XML root element declares a "xsi:noNamespaceSchemaLocation"
and false otherwise.
|
boolean |
hasProlog()
If document has {@code
|
boolean |
hasSchemaInstancePrefix()
Returns true if (xsi) schema instance prefix exists.
|
boolean |
hasSchemaLocation()
Returns true if XML root element declares a "xsi:schemaLocation" and false
otherwise.
|
boolean |
hasXMLModel()
Returns true if XML document has a xml-model processing declaration and false
otherwise.
|
DOMNode |
importNode(Node importedNode,
boolean deep) |
boolean |
isBeforeProlog(int offset)
Returns true, if the given offset is before XML declaration
(
<?xml ...?> ), false otherwise. |
boolean |
isDTD()
Returns true if the XML document is a DTD and false otherwise.
|
boolean |
isWithinInternalDTD(int offset)
Returns true if 'offset' is within an internal DOCTYPE dtd.
|
String |
lineDelimiter(int lineNumber) |
String |
lineText(int lineNumber) |
void |
normalizeDocument() |
int |
offsetAt(org.eclipse.lsp4j.Position position) |
org.eclipse.lsp4j.Position |
positionAt(int offset) |
DOMNode |
renameNode(Node n,
String namespaceURI,
String qualifiedName) |
void |
resetGrammar()
Reset the cached grammar flag.
|
void |
setCancelChecker(org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) |
void |
setDocumentURI(String documentURI) |
void |
setStrictErrorChecking(boolean strictErrorChecking) |
void |
setXmlStandalone(boolean xmlStandalone) |
void |
setXmlVersion(String xmlVersion) |
addChild, appendChild, cloneNode, compareDocumentPosition, findAttrAt, findAttrAt, findNodeAt, findNodeBefore, findNodeOrAttrAt, getAttribute, getAttributeAtIndex, getAttributeNode, getAttributeNode, getAttributeNodes, getAttributes, getBaseURI, getChild, getChildNodes, getChildren, getChildrenWithAttributeValue, getEnd, getFeature, getFirstChild, getLastChild, getLocalName, getNextSibling, getNodeValue, getOrphanEndElement, getParentElement, getParentNode, getPrefix, getPreviousNonTextSibling, getPreviousSibling, getStart, getTextContent, getUserData, hasAttribute, hasAttributes, hasChildNodes, insertBefore, isAttribute, isCDATA, isCharacterData, isChildOfOwnerDocument, isClosed, isComment, isDefaultNamespace, isDoctype, isDTDAttListDecl, isDTDElementDecl, isDTDEntityDecl, isDTDNotationDecl, isElement, isEqualNode, isGenericDTDDecl, isIncluded, isIncluded, isOwnerDocument, isProcessingInstruction, isProlog, isSameNode, isSupported, isText, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setAttribute, setAttributeNode, setNodeValue, setPrefix, setTextContent, setUserData, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNextSibling, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
public DOMDocument(TextDocument textDocument, URIResolverExtensionManager resolverExtensionManager)
public void setCancelChecker(org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
public org.eclipse.lsp4j.jsonrpc.CancelChecker getCancelChecker()
public org.eclipse.lsp4j.Position positionAt(int offset) throws BadLocationException
BadLocationException
public int offsetAt(org.eclipse.lsp4j.Position position) throws BadLocationException
BadLocationException
public String lineText(int lineNumber) throws BadLocationException
BadLocationException
public String lineDelimiter(int lineNumber) throws BadLocationException
BadLocationException
public LineIndentInfo getLineIndentInfo(int lineNumber) throws BadLocationException
BadLocationException
public org.eclipse.lsp4j.Range getElementNameRangeAt(int textOffset)
textOffset
- public String getNamespaceURI()
getNamespaceURI
in interface Node
getNamespaceURI
in class DOMNode
public String getText()
public TextDocument getTextDocument()
public boolean hasGrammar()
public SchemaLocation getSchemaLocation()
public boolean hasSchemaLocation()
public NoNamespaceSchemaLocation getNoNamespaceSchemaLocation()
public boolean hasNoNamespaceSchemaLocation()
public boolean hasNamespaces()
public String getSchemaInstancePrefix()
public boolean hasSchemaInstancePrefix()
public boolean hasProlog()
<?xml ... ?>
public DOMNode getProlog()
<?xml ... ?>
, return this prolog, null otherwisepublic boolean isBeforeProlog(int offset)
<?xml ...?>
), false otherwise.offset
- the offset position in questionpublic boolean hasDTD()
public boolean hasXMLModel()
public List<XMLModel> getXMLModels()
public boolean hasExternalGrammar()
public Map<String,String> getExternalGrammarLocation()
public String getExternalGrammarFromNamespaceURI()
public DOMElement createElement(int start, int end)
public DOMCDATASection createCDataSection(int start, int end)
public DOMProcessingInstruction createProcessingInstruction(int start, int end)
public DOMComment createComment(int start, int end)
public DOMText createText(int start, int end)
public DOMDocumentType createDocumentType(int start, int end)
public short getNodeType()
getNodeType
in interface Node
public String getNodeName()
getNodeName
in interface Node
public DOMElement getDocumentElement()
getDocumentElement
in interface Document
public DOMDocumentType getDoctype()
getDoctype
in interface Document
public DOMDocument getOwnerDocument()
DOMNode
getOwnerDocument
in interface DOMRange
getOwnerDocument
in interface Node
getOwnerDocument
in class DOMNode
public String getDocumentURI()
getDocumentURI
in interface Document
public void setDocumentURI(String documentURI)
setDocumentURI
in interface Document
public DOMNode adoptNode(Node source) throws DOMException
adoptNode
in interface Document
DOMException
public DOMAttr createAttribute(String name) throws DOMException
createAttribute
in interface Document
DOMException
public DOMAttr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException
createAttributeNS
in interface Document
DOMException
public CDATASection createCDATASection(String data) throws DOMException
createCDATASection
in interface Document
DOMException
public DOMComment createComment(String data)
createComment
in interface Document
public DocumentFragment createDocumentFragment()
createDocumentFragment
in interface Document
public DOMElement createElement(String tagName) throws DOMException
createElement
in interface Document
DOMException
public DOMElement createElementNS(String namespaceURI, String qualifiedName) throws DOMException
createElementNS
in interface Document
DOMException
public EntityReference createEntityReference(String name) throws DOMException
createEntityReference
in interface Document
DOMException
public DOMProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException
createProcessingInstruction
in interface Document
DOMException
public DOMText createTextNode(String data)
createTextNode
in interface Document
public DOMConfiguration getDomConfig()
getDomConfig
in interface Document
public DOMElement getElementById(String elementId)
getElementById
in interface Document
public NodeList getElementsByTagName(String tagname)
getElementsByTagName
in interface Document
public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagNameNS
in interface Document
public DOMImplementation getImplementation()
getImplementation
in interface Document
public String getInputEncoding()
getInputEncoding
in interface Document
public boolean getStrictErrorChecking()
getStrictErrorChecking
in interface Document
public String getXmlEncoding()
getXmlEncoding
in interface Document
public boolean getXmlStandalone()
getXmlStandalone
in interface Document
public String getXmlVersion()
getXmlVersion
in interface Document
public DOMNode importNode(Node importedNode, boolean deep) throws DOMException
importNode
in interface Document
DOMException
public void normalizeDocument()
normalizeDocument
in interface Document
public DOMNode renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException
renameNode
in interface Document
DOMException
public void setStrictErrorChecking(boolean strictErrorChecking)
setStrictErrorChecking
in interface Document
public void setXmlStandalone(boolean xmlStandalone) throws DOMException
setXmlStandalone
in interface Document
DOMException
public void setXmlVersion(String xmlVersion) throws DOMException
setXmlVersion
in interface Document
DOMException
public void resetGrammar()
public URIResolverExtensionManager getResolverExtensionManager()
public boolean isDTD()
public boolean isWithinInternalDTD(int offset)
offset
- public org.eclipse.lsp4j.Range getTrimmedRange(org.eclipse.lsp4j.Range range)
public org.eclipse.lsp4j.Range getTrimmedRange(int start, int end)
public Collection<DOMNode> findDTDAttrList(String elementName)
elementName
- public String getSchemaPrefix()
Copyright © 2021. All rights reserved.