Package org.w3c.dom.validation
Interface ElementEditVAL
- All Superinterfaces:
NodeEditVAL
- All Known Implementing Classes:
ElementImpl
This interface extends the
NodeEditVAL interface with
additional methods for guided document editing. An object implementing
this interface must also implement the Element interface.
This interface also has attributes that are a NameList of
elements or attributes which can appear in the specified context. Some
schema languages, i.e., W3C XML schema, define wildcards which provide
for validation of attribute and element information items dependent on
their namespace names but independent of their local names.
To expose wildcards, the NameList returns the values that
represent the namespace constraint:
-
{namespaceURI, name}is{null, ##any}if any; -
{namespaceURI, name}is{namespace_a, ##other}if not and a namespace name (namespace_a); -
{namespaceURI, name}is{null, ##other}if not and absent; -
Pairs of
{namespaceURI, name}with values{a_namespaceURI | null, null}if a set whose members are either namespace names or absent.
See also the Document Object Model (DOM) Level 3 Validation Specification.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortThe content model contains unordered child information item(s), i.e., element, processing instruction, unexpanded entity reference, character, and comment information items as defined in the XML Information Set.static final shortThe content model contains a sequence of element information items optionally separated by whitespace.static final shortThe content model does not allow any content.static final shortThe content model contains a sequence of ordered element information items optionally interspersed with character data.static final shortThe content model contains character information items.Fields inherited from interface org.w3c.dom.validation.NodeEditVAL
VAL_FALSE, VAL_INCOMPLETE, VAL_NS_WF, VAL_SCHEMA, VAL_TRUE, VAL_UNKNOWN, VAL_WF -
Method Summary
Modifier and TypeMethodDescriptionshortcanRemoveAttribute(String attrName) Verifies if an attribute by the given name can be removed.shortcanRemoveAttributeNode(Node attrNode) Determines if an attribute node can be removed.shortcanRemoveAttributeNS(String namespaceURI, String localName) Verifies if an attribute by the given local name and namespace can be removed.shortcanSetAttribute(String attrName, String attrval) Determines if the value for specified attribute can be set.shortcanSetAttributeNode(Attr attrNode) Determines if an attribute node can be added.shortcanSetAttributeNS(String namespaceURI, String qualifiedName, String value) Determines if the attribute with given namespace and qualified name can be created if not already present in the attribute list of the element.shortcanSetTextContent(String possibleTextContent) Determines if the text content of this node and its descendants can be set to the string passed in.ANameList, as described in [DOM Level 3 Core], of all possible attribute information items or wildcards that can appear as attributes of this element, ornullif this element has no context or schema.ANameList, as described in [DOM Level 3 Core], of all possible element information items or wildcards that can appear as children of this element, ornullif this element has no context or schema.ANameList, as described in [DOM Level 3 Core], of all possible element information items or wildcards that can appear as a first child of this element, ornullif this element has no context or schema.ANameList, as described in [DOM Level 3 Core], of all element information items or wildcards that can be inserted as a next sibling of this element, ornullif this element has no context or schema.ANameList, as described in [DOM Level 3 Core], of all possible element information items that can appear as a parent this element, ornullif this element has no context or schema.ANameList, as described in [DOM Level 3 Core], of all element information items or wildcards that can be inserted as a previous sibling of this element, ornullif this element has no context or schema.shortThe content type of an element as defined above.ANameList, as described in [DOM Level 3 Core], of required attribute information items that must appear on this element, ornullif this element has no context or schema.shortisElementDefined(String name) Determines ifnameis defined in the schema.shortisElementDefinedNS(String namespaceURI, String name) Determines ifnamein this namespace is defined in the current context.Methods inherited from interface org.w3c.dom.validation.NodeEditVAL
canAppendChild, canInsertBefore, canInsertBefore, canRemoveChild, canReplaceChild, getDefaultValue, getEnumeratedValues, nodeValidity
-
Field Details
-
VAL_EMPTY_CONTENTTYPE
static final short VAL_EMPTY_CONTENTTYPEThe content model does not allow any content. If the schema is a W3C XML schema, this corresponds to theemptycontent type; and if the schema is a DTD, this corresponds to theEMPTYcontent model.- See Also:
-
VAL_ANY_CONTENTTYPE
static final short VAL_ANY_CONTENTTYPEThe content model contains unordered child information item(s), i.e., element, processing instruction, unexpanded entity reference, character, and comment information items as defined in the XML Information Set. If the schema is a DTD, this corresponds to theANYcontent model.- See Also:
-
VAL_MIXED_CONTENTTYPE
static final short VAL_MIXED_CONTENTTYPEThe content model contains a sequence of ordered element information items optionally interspersed with character data. If the schema is a W3C XML schema, this corresponds to themixedcontent type.- See Also:
-
VAL_ELEMENTS_CONTENTTYPE
static final short VAL_ELEMENTS_CONTENTTYPEThe content model contains a sequence of element information items optionally separated by whitespace. If the schema is a DTD, this is theelement contentcontent model; and if the schema is a W3C XML schema, this is theelement-onlycontent type.- See Also:
-
VAL_SIMPLE_CONTENTTYPE
static final short VAL_SIMPLE_CONTENTTYPEThe content model contains character information items. If the schema is a W3C XML schema, then the element has a content type ofVAL_SIMPLE_CONTENTTYPEif the type of the element is asimple type definition, or the type of the element is acomplexTypewhose{content type}is asimple type definition.- See Also:
-
-
Method Details
-
getAllowedChildren
NameList getAllowedChildren()ANameList, as described in [DOM Level 3 Core], of all possible element information items or wildcards that can appear as children of this element, ornullif this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated. -
getAllowedFirstChildren
NameList getAllowedFirstChildren()ANameList, as described in [DOM Level 3 Core], of all possible element information items or wildcards that can appear as a first child of this element, ornullif this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated. -
getAllowedParents
NameList getAllowedParents()ANameList, as described in [DOM Level 3 Core], of all possible element information items that can appear as a parent this element, ornullif this element has no context or schema. -
getAllowedNextSiblings
NameList getAllowedNextSiblings()ANameList, as described in [DOM Level 3 Core], of all element information items or wildcards that can be inserted as a next sibling of this element, ornullif this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated. -
getAllowedPreviousSiblings
NameList getAllowedPreviousSiblings()ANameList, as described in [DOM Level 3 Core], of all element information items or wildcards that can be inserted as a previous sibling of this element, ornullif this element has no context or schema. -
getAllowedAttributes
NameList getAllowedAttributes()ANameList, as described in [DOM Level 3 Core], of all possible attribute information items or wildcards that can appear as attributes of this element, ornullif this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated. -
getRequiredAttributes
NameList getRequiredAttributes()ANameList, as described in [DOM Level 3 Core], of required attribute information items that must appear on this element, ornullif this element has no context or schema. -
getContentType
short getContentType()The content type of an element as defined above. -
canSetTextContent
Determines if the text content of this node and its descendants can be set to the string passed in.- Parameters:
possibleTextContent- Possible text content string.- Returns:
- A validation state constant.
-
canSetAttribute
Determines if the value for specified attribute can be set.- Parameters:
attrName- Name of attribute.attrval- Value to be assigned to the attribute.- Returns:
- A validation state constant.
-
canSetAttributeNode
Determines if an attribute node can be added.- Parameters:
attrNode-Nodein which the attribute can possibly be set.- Returns:
- A validation state constant.
-
canSetAttributeNS
Determines if the attribute with given namespace and qualified name can be created if not already present in the attribute list of the element. If the attribute with the same qualified name and namespaceURI is already present in the element's attribute list, it tests whether the value of the attribute and its prefix can be set to the new value.- Parameters:
namespaceURI-namespaceURIof namespace.qualifiedName- Qualified name of attribute.value- Value to be assigned to the attribute.- Returns:
- A validation state constant.
-
canRemoveAttribute
Verifies if an attribute by the given name can be removed.- Parameters:
attrName- Name of attribute.- Returns:
- A validation state constant.
-
canRemoveAttributeNS
Verifies if an attribute by the given local name and namespace can be removed.- Parameters:
namespaceURI- The namespace URI of the attribute to remove.localName- Local name of the attribute to be removed.- Returns:
- A validation state constant.
-
canRemoveAttributeNode
Determines if an attribute node can be removed.- Parameters:
attrNode- TheAttrnode to remove from the attribute list.- Returns:
- A validation state constant.
-
isElementDefined
Determines ifnameis defined in the schema. This only applies to global declarations. This method is for non-namespace aware schemas.- Parameters:
name- Name of element.- Returns:
- A validation state constant.
-
isElementDefinedNS
Determines ifnamein this namespace is defined in the current context. Thus not only does this apply to global declarations . but depending on the content, this may also apply to local definitions. This method is for namespace aware schemas.- Parameters:
namespaceURI-namespaceURIof namespace.name- Name of element.- Returns:
- A validation state constant.
-