Interface ElementEditVAL

All Superinterfaces:
NodeEditVAL
All Known Implementing Classes:
ElementImpl

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

    • VAL_EMPTY_CONTENTTYPE

      static final short VAL_EMPTY_CONTENTTYPE
      The content model does not allow any content. If the schema is a W3C 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:
    • VAL_ANY_CONTENTTYPE

      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:
    • VAL_MIXED_CONTENTTYPE

      static final short VAL_MIXED_CONTENTTYPE
      The 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 the mixed content type.
      See Also:
    • VAL_ELEMENTS_CONTENTTYPE

      static final short VAL_ELEMENTS_CONTENTTYPE
      The content model contains a sequence of element information items optionally separated by whitespace. If the schema is a DTD, this is the element content content model; and if the schema is a W3C XML schema, this is the element-only content type.
      See Also:
    • VAL_SIMPLE_CONTENTTYPE

      static final short VAL_SIMPLE_CONTENTTYPE
      The content model contains character information items. If the schema is a W3C XML schema, then the element has a content type of VAL_SIMPLE_CONTENTTYPE if the type of the element is a simple type definition, or the type of the element is a complexType whose {content type} is a simple type definition.
      See Also:
  • Method Details

    • getAllowedChildren

      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.
    • getAllowedFirstChildren

      NameList getAllowedFirstChildren()
      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

      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

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

      NameList getAllowedPreviousSiblings()
      A NameList, 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, or null if this element has no context or schema.
    • getAllowedAttributes

      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

      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.
    • getContentType

      short getContentType()
      The content type of an element as defined above.
    • canSetTextContent

      short canSetTextContent(String possibleTextContent)
      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

      short canSetAttribute(String attrName, 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

      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

      short canSetAttributeNS(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. 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 - namespaceURI of namespace.
      qualifiedName - Qualified name of attribute.
      value - Value to be assigned to the attribute.
      Returns:
      A validation state constant.
    • canRemoveAttribute

      short canRemoveAttribute(String attrName)
      Verifies if an attribute by the given name can be removed.
      Parameters:
      attrName - Name of attribute.
      Returns:
      A validation state constant.
    • canRemoveAttributeNS

      short canRemoveAttributeNS(String namespaceURI, 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

      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

      short isElementDefined(String name)
      Determines if name is 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

      short isElementDefinedNS(String namespaceURI, 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. This method is for namespace aware schemas.
      Parameters:
      namespaceURI - namespaceURI of namespace.
      name - Name of element.
      Returns:
      A validation state constant.