Interface CMDocument
- All Known Implementing Classes:
CMDTDDocument,CMRelaxNGDocument,CMXSDDocument
public interface CMDocument
Content model document which abstracts element declaration from a given
grammar (XML Schema, DTD).
-
Method Summary
Modifier and TypeMethodDescriptiondefault CMAttributeDeclarationfindCMAttribute(DOMAttr attr) default CMElementDeclarationfindCMElement(DOMElement element) Returns the declared element which matches the given XML element and null otherwise.findCMElement(DOMElement element, String namespace) Returns the declared element which matches the given XML element and null otherwise.default Collection<String> findDerivedTypeNames(DOMElement element) Returns the names of types that can be used as xsi:type values for the given element (i.e. derived types of the element's declared type).org.eclipse.lsp4j.LocationLinkfindTypeLocation(DOMNode node) Returns the location of the type definition of the given node.default Collection<CMElementDeclaration> findXsiTypeDerivedElements(DOMElement element) Returns the child element declarations of the xsi:type-derived type for the given element.Returns the elements declaration of the model document root.Returns list of declared entities.default StringReturns the target namespace of this grammar document, ornullif the grammar has no target namespace (e.g., a no-namespace XSD or a DTD).booleanhasNamespace(String namespaceURI) Returns true if the model document defines the given namespace and false otherwise.booleanisDirty()Returns true if the content model document is dirty and false otherwise.
-
Method Details
-
getNamespace
Returns the target namespace of this grammar document, ornullif the grammar has no target namespace (e.g., a no-namespace XSD or a DTD).- Returns:
- the target namespace URI, or
null.
-
hasNamespace
Returns true if the model document defines the given namespace and false otherwise.- Parameters:
namespaceURI-- Returns:
- true if the model document defines the given namespace and false otherwise.
-
getElements
Collection<CMElementDeclaration> getElements()Returns the elements declaration of the model document root.- Returns:
- the elements declaration of the model document root.
-
findCMElement
Returns the declared element which matches the given XML element and null otherwise.- Parameters:
element- the XML element- Returns:
- the declared element which matches the given XML element and null otherwise.
-
findCMElement
Returns the declared element which matches the given XML element and null otherwise.- Parameters:
element- the XML elementnamespace- the given namespace- Returns:
- the declared element which matches the given XML element and null otherwise.
-
findCMAttribute
-
findTypeLocation
Returns the location of the type definition of the given node.- Parameters:
node- the node- Returns:
- the location of the type definition of the given node.
-
isDirty
boolean isDirty()Returns true if the content model document is dirty and false otherwise.- Returns:
- true if the content model document is dirty and false otherwise.
-
findDerivedTypeNames
Returns the names of types that can be used as xsi:type values for the given element (i.e. derived types of the element's declared type).- Parameters:
element- the DOM element- Returns:
- the collection of qualified type names.
-
findXsiTypeDerivedElements
Returns the child element declarations of the xsi:type-derived type for the given element. Used when the derived type is defined in this schema but the element itself belongs to a different namespace.- Parameters:
element- the DOM element with xsi:type attribute.- Returns:
- the child element declarations, or empty if not applicable.
-
getEntities
Returns list of declared entities.- Returns:
- list of declared entities.
-