Oracle® XML Java API Reference
Release 1 (10.1)

B12024-01

org.w3c.dom.validation
Interface ElementEditVAL

All Superinterfaces:
NodeEditVAL
All Known Implementing Classes:
XMLElement

public interface ElementEditVAL
extends NodeEditVAL

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., 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:

See also the Document Object Model (DOM) Level 3 Validation Specification.


Field Summary
static short VAL_ANY_CONTENTTYPE
          The 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 short VAL_ELEMENTS_CONTENTTYPE
          The content model contains a sequence of ele ment information items optionally separated by whitespace.
static short VAL_EMPTY_CONTENTTYPE
          The content model does not allow any content.
static short VAL_MIXED_CONTENTTYPE
          The content model contains a sequence of ordered ele ment information items optionally interspersed with character data.
static short VAL_SIMPLE_CONTENTTYPE
          The 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
 short canRemoveAttribute(java.lang.String attrname)
          Verifies if an attribute by the given name can be removed.
 short canRemoveAttributeNode(Node attrNode)
          Determines if an attribute node can be removed.
 short canRemoveAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
          Verifies if an attribute by the given local name and namespace can be removed.
 short canSetAttribute(java.lang.String attrname, java.lang.String attrval)
          Determines if the value for specified attribute can be set.
 short canSetAttributeNode(Attr attrNode)
          Determines if an attribute node can be added.
 short canSetAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.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.
 NameList getAllowedAttributes()
          A NameList, as described in [DOM Level 3 Core] , of all possible attribute information items or wildcards that can appear as attributes of this element, or null if this element has no context or schema.
 NameList getAllowedChildren()
          A NameList, as described in [DOM Level 3 Core] , of all possible element information items or wildcards that can appear as children of this element, or null if this element has no context or schema.
 NameList getAllowedFirstChildElements()
          A NameList, 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, or null if this element has no context or schema.
 NameList getAllowedNextSiblings()
          A NameList, as described in [DOM Level 3 Core] , of all possible element information items or wildcards that can appear as a next sibling of this element, or null if this element has no context or schema.
 NameList getAllowedParents()
          A NameList, as described in [DOM Level 3 Core] , of all possible element information items that can appear as a parent this element, or null if this element has no context or schema.
 NameList getAllowedPreviousSiblings()
          A NameList, as described in [DOM Level 3 Core] , of all possible element information items or wildcards that can appear as a previous sibling of this element, or null if this element has no context or schema.
 short getContentType()
          The content type of an element.
 NameList getRequiredAttributes()
          A NameList, as described in [DOM Level 3 Core] , of required attribute information items that must appear on this element, or null if this element has no context or schema.
 short isElementDefined(java.lang.String name)
          Determines if name is defined in the schema.
 short isElementDefinedNS(java.lang.String namespaceURI, java.lang.String name)
          Determines if name in this namespace is defined in the current context.

 

Methods inherited from interface org.w3c.dom.validation.NodeEditVAL
canAppendChild, canInsertBefore, canRemoveChild, canReplaceChild, getDefaultValue, getEnumeratedValues, nodeValidity

 

Field Detail

VAL_EMPTY_CONTENTTYPE

public static final short VAL_EMPTY_CONTENTTYPE
The content model does not allow any content. If the schema is an XML Schema, this corresponds to the empty content type; and if the schema is a DTD, this corresponds to the EMPTY content model.
See Also:
Constant Field Values

VAL_ANY_CONTENTTYPE

public static final short VAL_ANY_CONTENTTYPE
The 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 the ANY content model.
See Also:
Constant Field Values

VAL_MIXED_CONTENTTYPE

public static final short VAL_MIXED_CONTENTTYPE
The content model contains a sequence of ordered ele ment information items optionally interspersed with character data. If the schema is an XML Schema, this corresponds to the mixed content type.
See Also:
Constant Field Values

VAL_ELEMENTS_CONTENTTYPE

public static final short VAL_ELEMENTS_CONTENTTYPE
The content model contains a sequence of ele ment information items optionally separated by whitespace. If the schema is a DTD, this is the element content content model; and if the schema is an XML Schema, this is the element-only content type.
See Also:
Constant Field Values

VAL_SIMPLE_CONTENTTYPE

public static final short VAL_SIMPLE_CONTENTTYPE
The content model contains character information items. If the schema is an XML Schema, this corresponds to the simple type definition.
See Also:
Constant Field Values
Method Detail

getAllowedChildren

public NameList getAllowedChildren()
A NameList, as described in [DOM Level 3 Core] , of all possible element information items or wildcards that can appear as children of this element, or null if this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated.

getAllowedFirstChildElements

public NameList getAllowedFirstChildElements()
A NameList, 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, or null if this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated.

getAllowedParents

public NameList getAllowedParents()
A NameList, as described in [DOM Level 3 Core] , of all possible element information items that can appear as a parent this element, or null if this element has no context or schema.

getAllowedNextSiblings

public NameList getAllowedNextSiblings()
A NameList, as described in [DOM Level 3 Core] , of all possible element information items or wildcards that can appear as a next sibling of this element, or null if this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated.

getAllowedPreviousSiblings

public NameList getAllowedPreviousSiblings()
A NameList, as described in [DOM Level 3 Core] , of all possible element information items or wildcards that can appear as a previous sibling of this element, or null if this element has no context or schema.

getAllowedAttributes

public NameList getAllowedAttributes()
A NameList, as described in [DOM Level 3 Core] , of all possible attribute information items or wildcards that can appear as attributes of this element, or null if this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated.

getRequiredAttributes

public NameList getRequiredAttributes()
A NameList, as described in [DOM Level 3 Core] , of required attribute information items that must appear on this element, or null if this element has no context or schema. Duplicate pairs of {namespaceURI, name} are eliminated.

getContentType

public short getContentType()
The content type of an element.

canSetAttribute

public short canSetAttribute(java.lang.String attrname,
                             java.lang.String attrval)
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

public short canSetAttributeNode(Attr attrNode)
Determines if an attribute node can be added.
Parameters:
attrNode - Node in which the attribute can possibly be set.
Returns:
A validation state constant.

canSetAttributeNS

public short canSetAttributeNS(java.lang.String namespaceURI,
                               java.lang.String qualifiedName,
                               java.lang.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. 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. See DOM core setAttributeNS.
Parameters:
namespaceURI - namespaceURI of namespace.
qualifiedName - Qualified name of attribute.
value - Value to be assigned to the attribute.
Returns:
A validation state constant.

canRemoveAttribute

public short canRemoveAttribute(java.lang.String attrname)
Verifies if an attribute by the given name can be removed.
Parameters:
attrname - Name of attribute.
Returns:
A validation state constant.

canRemoveAttributeNS

public short canRemoveAttributeNS(java.lang.String namespaceURI,
                                  java.lang.String localName)
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

public short canRemoveAttributeNode(Node attrNode)
Determines if an attribute node can be removed.
Parameters:
attrNode - The Attr node to remove from the attribute list.
Returns:
A validation state constant.

isElementDefined

public short isElementDefined(java.lang.String name)
Determines if name is defined in the schema. This only applies to global declarations.
Parameters:
name - Name of element.
Returns:
A validation state constant.

isElementDefinedNS

public short isElementDefinedNS(java.lang.String namespaceURI,
                                java.lang.String name)
Determines if name in 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.
Parameters:
namespaceURI - namespaceURI of namespace.
name - Name of element.
Returns:
A validation state constant.

Oracle® XML Java API Reference
Release 1 (10.1)

B12024-01