[7] This is a work-in-progress documentation for manakai's DOM extensions. * New interfaces - [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] - [CODE(DOMi)@en[[[DocumentTypeDeclaration]]]] (Work in progress) - [CODE(DOMi)@en[[[ElementTypeDefinition]]]] - [CODE(DOMi)@en[[[AttributeDefinition]]]] - [CODE(DOMi)@en[[[SerialWalker]]]] * Extensions to the [CODE(DOMi)@en[Node]] interface ** New node types [10] The constant [CODE(DOMc)@en[[[ELEMENT_TYPE_DEFINITION_NODE]]]], [CODE(IDL)[[[81001]]]] in [CODE(IDL)@en[[[unsigned short]]]], represents that the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[ElementTypeDefinition]]]]. [11] The constant [CODE(DOMc)@en[[[ATTRIBUTE_DEFINITION_NODE]]]], [CODE(IDL)[[[81002]]]] in [CODE(IDL)@en[[[unsigned short]]]], represents that the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[AttributeDefinition]]]]. ** New element type accessors [9] The [DFN@en[[CODE(DOMa)@en[[[manakaiLocalName]]]] attribute]] contains the [Q@en[real]] local name of the [CODE(DOMi)@en[[[Node]]]]. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-only. The getter of this attribute [['''MUST''']] return the same value as the [CODE(DOMa)@en[[[localName]]]] on the same [CODE(DOMi)@en[[[Node]]]], except when the [CODE(DOMa)@en[[[localName]]]] getter is so defined that it must return the canonicalized version of [Q@en[real]] local name, in that case the [Q@en[real]] local name [['''MUST''']] be returned. ;; For example, the [[HTML 5]] specification defines that the [CODE(DOMa)@en[[[localName]]]] getter of the [CODE(DOMi)@en[[[HTMLElement]]]] in an HTML document will return uppercased local name of the [CODE(DOMi)@en[[[Element]]]]. The [CODE(DOMa)@en[[[manakaiLocalName]]]] getter return the local name without any case folding even on such [CODE(DOMi)@en[[[Element]]]]. [5] The [DFN@en[[CODE(DOMa)@en[[[manakaiExpandedURI]]]] attribute]] contans the expanded URI, i.e. the concatenation of the namespace URI and the local name of the [CODE(DOMi)@en[[[Node]]]]. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-only. = If the [CODE(DOMa)@en[[[manakaiLocalName]]]] of the [CODE(DOMi)@en[[[Node]]]] is [CODE(IDL)@en[[[null]]]], then the getter [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. = Otherwise, if the [CODE(DOMa)@en[[[namespaceURI]]]] of the [CODE(DOMi)@en[[[Node]]]] is [CODE(IDL)@en[[[null]]]], then the getter [['''MUST''']] return the [CODE(DOMa)@en[[[manakaiLocalName]]]] of the [CODE(DOMi)@en[[[Node]]]]. = Otherwise, the getter [['''MUST''']] return the concatenation of the [CODE(DOMa)@en[[[namespaceURI]]]] and then [CODE(DOMa)@en[[[manakaiLocalName]]]]. ** New tree accessor and mutator [4] The [DFN@en[[CODE(DOMa)@en[[[manakaiParentElement]]]] attribute]] contains the parent element of the [CODE(DOMi)@en[[[Node]]]], if any. The type of this attribute is [CODE(DOMi)@en[[[Element]]]]. This attribute is read-only. = If the [CODE(DOMa)@en[[[parentNode]]]] of the [CODE(DOMi)@en[[[Node]]]] is [CODE(IDL)@en[[[null]]]], then the getter [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. = Otherwise, if the [CODE(DOMa)@en[[[parentNode]]]] of the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[Element]]]], then the getter [['''MUST''']] return that [CODE(DOMi)@en[[[Element]]]]. = Otherwise, the getter [['''MUST''']] return the [CODE(DOMa)@en[[[manakaiParentElement]]]] of the [CODE(DOMa)@en[[[parentNode]]]] of the [CODE(DOMi)@en[[[Node]]]]. It might be [CODE(IDL)@en[[[null]]]]. @@ ISSUE: Should the owner element be returned for an [CODE(DOMi)@en[[[Attr]]]]? [3] The [DFN@en[[CODE(DOMm)@en[[[manakaiAppendText]]]] method]] appends a string at the end of the [CODE(DOMi)@en[[[Node]]]]. This method has a parameter, [CODE(DOMp)@en[[[s]]]]. [CODE(DOMp)@en[[[s]]]] is a string that is to be appended. Its type is [CODE(DOMi)@en[[[DOMString]]]]. This method [['''MUST''']] return the [CODE(DOMi)@en[[[Node]]]] itself. ;; It is the original intention that for the DOM Perl binding the [CODE(perl)[[[.=]]]] operator is to be overloaded by this method. However, since overloading that operator by this method makes the [[Perl]] implementation (at least Perl 5.8.1 and 5.8.7 on GNU/Linux system) unstable, that feature is temporarily disabled. If the [CODE(DOMi)@en[[[Node]]]] is either [CODE(DOMi)@en[[[DocumentFragment]]]], [CODE(DOMi)@en[[[EntityReference]]]], [CODE(DOMi)@en[[[Element]]]], [CODE(DOMi)@en[[[Attr]]]], [CODE(DOMi)@en[[[Entity]]]], or [CODE(DOMi)@en[[[AttributeDefinition]]]], then the string is appended to the end of the text content of the [CODE(DOMi)@en[[[Node]]]]. Formally: - If the [CODE(DOMp)@en[[[s]]]] is empty (zero-length), then the [['''MUST''']] do nothing. - Otherwise, if the [CODE(DOMa)@en[[[lastChild]]]] is a [CODE(DOMi)@en[[[Text]]]] (not [CODE(DOMi)@en[[[CDATASection]]]]), then the method [['''MUST''']] append the [CODE(DOMp)@en[[[p]]]] to the [CODE(DOMa)@en[[[data]]]] attribute of the [CODE(DOMi)@en[[[Text]]]]. If the [CODE(DOMi)@en[[[Text]]]] is read-only, then the method [['''MUST''']] throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception without any mutation. - Otherwise, a new [CODE(DOMi)@en[[[Text]]]] (not [CODE(DOMi)@en[[[CDATASection]]]]) whose [CODE(DOMa)@en[[[data]]]] is set to [CODE(DOMp)@en[[[s]]]] [['''MUST''']] be appended to the [CODE(DOMi)@en[[[Node]]]]. If the [CODE(DOMi)@en[[[Node]]]] is read-only, then the method [['''MUST''']] throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception without any mutation. If the [CODE(DOMi)@en[[[Node]]]] is a [CODE(DOMi)@en[[[Document]]]]: When the [CODE(URI)@en[[[http://suika.fam.cx/www/2006/dom-config/strict-document-children]]]] configuration parameter is set to [CODE(IDL)@en[[[false]]]], then the method [['''MUST''']] act as if the [CODE(DOMi)@en[[[Node]]]] is a [CODE(DOMi)@en[[[DocumentFragment]]]]. Otherwise, the method [['''MUST''']] do nothing. If the [CODE(DOMi)@en[[[Node]]]] is either [CODE(DOMi)@en[[[ProcessingInstruction]]]], [CODE(DOMi)@en[[[Comment]]]], [CODE(DOMi)@en[[[Text]]]], or [CODE(DOMi)@en[[[CDATASection]]]], then [CODE(DOMp)@en[[[s]]]] [['''MUST''']] be appended to the [CODE(DOMa)@en[[[textContent]]]] of the [CODE(DOMi)@en[[[Node]]]]. If the [CODE(DOMi)@en[[[Node]]]] is read-only, then the method [['''MUST''']] throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception without any mutation. For the other types of [CODE(DOMi)@en[[[Node]]]]s, this method [['''MUST NOT''']] has any effect. @@ TODO: How mutation events are dispatched must be defined. ** Read-only flag accessors [1] The [DFN@en[[CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute]] represents whether the [CODE(DOMi)@en[[[Node]]]] is read-only or not. This is a [CODE(IDL)@en[[[boolean]]]] attribute. This attribute is [[read-only]]. The getter [['''MUST''']] return [CODE(IDL)@en[[[true]]]] if the [CODE(DOMi)@en[[[Node]]]] is read-only. Otherwise, it [['''MUST''']] return [CODE(IDL)@en[[[false]]]]. [2] The [DFN@en[[CODE(DOMm)@en[[[manakaiSetReadOnly]]]] method]] is used to set the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute. This method has two parameters: [CODE(DOMp)@en[[[newValue]]]] and [CODE(DOMp)@en[[[deep]]]]. This method returns nothing. [CODE(DOMp)@en[[[newValue]]]], type [CODE(IDL)@en[[[boolean]]]], represents the new value of the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute. [CODE(DOMp)@en[[[deep]]]], type [CODE(IDL)@en[[[boolean]]]]. represents whether the descendants' [CODE(DOMa)@en[[[manakaiReadOnly]]]] attributes should also be set or not. When invoked, the method [['''MUST''']] set the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute, i.e. the read-only flag, of the [CODE(DOMi)@en[[[Node]]]] to [CODE(DOMp)@en[[[newValue]]]]. If the [CODE(DOMp)@en[[[deep]]]] parameter is set to [CODE(IDL)@en[[[true]]]], then the method [['''MUST''']] act as if the method is also invoked to any of the following [CODE(DOMi)@en[[[Node]]]]s with same [CODE(DOMp)@en[[[newValue]]]] and [CODE(DOMp)@en[[[deep]]]] parameters: - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[childNodes]]]] of the [CODE(DOMi)@en[[[Node]]]] - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[attributes]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is an [CODE(DOMi)@en[[[Element]]]]) - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[elementTypes]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is a [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]) - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[generalEntities]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is a [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]) - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[notations]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is a [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]) - [CODE(DOMi)@en[[[Node]]]]s contained in [CODE(DOMa)@en[[[attributeDefinitions]]]] of the [CODE(DOMi)@en[[[Node]]]] (if it is a [CODE(DOMi)@en[[[ElementTypeDefinition]]]]) ** Metadata accessor [6] The [DFN@en[[CODE(DOMa)@en[[[manakaiLanguage]]]] attribute]] contans the language information of the [CODE(DOMi)@en[[[Node]]]], if available. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-write. This getter [['''MUST''']] act as if the following algorithm is performed: = If the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[Element]]]]: == If there is an [CODE(DOMi)@en[[[Attr]]]], in the [CODE(DOMa)@en[[[attributes]]]] list of the [CODE(DOMi)@en[[[Element]]]], whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(URI)@en[[[http://www.w3.org/XML/1998/namespace]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[lang]]]], then the getter returns the [CODE(DOMa)@en[[[value]]]] of the [CODE(DOMi)@en[[[Attr]]]]. == Otherwise, if there is an [CODE(DOMi)@en[[[Attr]]]], in the [CODE(DOMa)@en[[[attributes]]]] list of the [CODE(DOMi)@en[[[Element]]]], whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(IDL)@en[[[null]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[xml]]:[[lang]]]], then the getter returns the [CODE(DOMa)@en[[[value]]]] of the [CODE(DOMi)@en[[[Attr]]]]. = If the [CODE(DOMi)@en[[[Node]]]] has a non-[CODE(IDL)@en[[[null]]]] [CODE(DOMi)@en[[[parentNode]]]], then the getter returns the [CODE(DOMa)@en[[[manakaiLanguage]]]] of that [CODE(DOMi)@en[[[Node]]]]. = Otherwise, if the [CODE(DOMi)@en[[[Node]]]] has a non-[CODE(IDL)@en[[[null]]]] [CODE(DOMa)@en[[[ownerDocument]]]], then the getter returns the [CODE(DOMa)@en[[[manakaiLanguage]]]] of that [CODE(DOMi)@en[[[Node]]]]. = Otherwise, if the [CODE(DOMi)@en[[[Node]]]] is a [CODE(DOMi)@en[[[Document]]]] and any natural language information is attached to the [CODE(DOMi)@en[[[Document]]]], for example by [CODE(HTTP)@en[[[Content-Language]]]] [[HTTP]] header field, then the getter returns it. -- If such information has different syntax and / or semantics than one for the [CODE(XMLa)@en[[[xml]]:[[lang]]]] attributes as defined in XML 1.0 and 1.1 specifications, then the getter [['''MUST''']] return an XML-compatible string that is considered as equivalent to that information. -- If such convertion if not possible, then the getter [['''MUST NOT''']] return any string in this step. -- If more than one languages are specified, then the string [CODE(lang)@en[[[mul]]]] [['''MAY''']] be used. = Otherwise, the getter returns [CODE(IDL)@en[[[null]]]]. @@ TODO: Maybe we should clarify what convertion must be done for [CODE(DOMi)@en[[[Document]]]]s. @@ TODO: [[HTML]] [CODE(HTMLa)@en[[[lang]]]] support The setter [['''MUST''']] act as if the following algorithm is performed: = Let [VAR@en[s]] as the new value given to the attribute. = If the [CODE(DOMi)@en[[[Node]]]] is an [CODE(DOMi)@en[[[Element]]]]: == If the [CODE(DOMi)@en[[[Node]]]] has one or two [CODE(DOMi)@en[[[Attr]]]]s whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(URI)@en[[[http://www.w3.org/XML/1998/namespace]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[lang]]]] or whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE@en[[[null]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[xml]]:[[lang]]]], then: === If the [CODE(DOMi)@en[[[Element]]]] is read-only, then throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exceoption and abort the algorithm. === Otherwise, any such [CODE(DOMi)@en[[[Attr]]]] [['''MUST''']] be removed from the [CODE(DOMi)@en[[[Element]]]] as if [CODE(DOMm)@en[[[removeAttributeNode]]]] is invoked with appropriate parameter. ---- Note that a default attribute might appear after the remove operation. == Otherwise, if the element has an [CODE(DOMi)@en[[[Attr]]]] whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(URI)@en[[[http://www.w3.org/XML/1998/namespace]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[lang]]]]: === If the [CODE(DOMi)@en[[[Attr]]]] is read-only, then throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exceoption and abort the algorithm. === Otherwise, set its [CODE(DOMa)@en[[[value]]]] to [VAR@en[s]] and set its [CODE(DOMa)@en[[[specified]]]] to [CODE(IDL)@en[[[true]]]]. == Otherwise, if the element has an [CODE(DOMi)@en[[[Attr]]]] whose [CODE(DOMa)@en[[[namespaceURI]]]] is [CODE(IDL)@en[[[null]]]] and [CODE(DOMa)@en[[[localName]]]] is [CODE(XMLa)@en[[[xml]]:[[lang]]]]: === If the [CODE(DOMi)@en[[[Attr]]]] is read-only, then throw a [CODE(DOM)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exceoption and abort the algorithm. === Otherwise, set its [CODE(DOMa)@en[[[value]]]] to [VAR@en[s]] and set its [CODE(DOMa)@en[[[specified]]]] to [CODE(IDL)@en[[[true]]]]. == Otherwise, invoke the [CODE(DOMm)@en[[[setAttributeNS]]]] method on the [CODE(DOMi)@en[[[Element]]]] with parameters [CODE(URI)@en[[[http://www.w3.org/XML/1998/namespace]]]], [CODE(XMLa)@en[[[xml]]:[[lang]]]], and [VAR@en[s]]. --- Note that this might cause an exception is thrown. = Otherwise, setter do nothing. @@ TODO: Setter for [CODE(DOMi)@en[[[Document]]]]. @@ TODO: mutation event consideration * Extension to the [CODE(DOMi)@en[Document]] interface ** Setter additions [17] The [DFN@en[[CODE(DOMa)@en[[[inputEncoding]]]]]] and [DFN@en[[CODE(DOMa)@en[[[xmlEncoding]]]]]] attributes are now read-write. On setting, if the [CODE(DOMi)@en[[[Document]]]] is read-only, then a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [['''MUST''']] be thrown. Otherwise, the attribute [['''MUST''']] be set to the new value, even if it is [CODE(IDL)@en[[[null]]]]. Note that no lexical checking is performed on the setting. ** Metadata accessors [15] The [DFN@en[[CODE(DOMa)@en[manakaiEntityBaseURI]] attribute]] contains the base DOM URI of the document entity. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-write. If the [CODE(DOMi)@en[[[Document]]]] has the base URI information (in XML infoset terminology, the [CODE(InfoProp)@en[[[base URI]]]] property), then the getter [['''MUST''']] return that base URI. Otherwise, the getter [['''MUST''']] return the [CODE(DOMa)@en[[[documentURI]]]] of the [CODE(DOMi)@en[[[Document]]]], possibly [CODE(IDL)@en[[[null]]]]. Note that these result in returning a [CODE(DOMi)@en[[[DOMString]]]] that is not a legal absolute URI, if the base URI information or [CODE(DOMa)@en[[[documentURI]]]] does not contain a legal absolute URI. On setting, if the [CODE(DOMi)@en[[[Document]]]] is read-only, then a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [['''MUST''']] be thrown. Otherwise, if the new value is [CODE(IDL)@en[[[null]]]], then the base URI information, if any, is unset. If the new value is non-[CODE(IDL)@en[[[null]]]], then the base URI information is set to that value. Note that no lexical checking is performed on that value. Note also that setting this attribute does not affect on the [CODE(DOMa)@en[[[documentURI]]]] attribute. It is expected that if the [CODE(DOMi)@en[[[Document]]]] is created from an XML document entity retrieved from an HTTP entity, then the [CODE(HTTP)@en[[[Content-Location]]:]] and / or [CODE(HTTP)@en[[[Content-Base]]:]] header fields, if any, are reflected to this attribute. [16] The [DFN@en[[CODE(DOMa)@en[[[allDeclarationsProcessed]]]] attribute]] contains a value that represents whether the XML processor has read the complete DTD when the XML document is parsed. This attribute corresponding to the [CODE(InfoProp)@en[[[all declarations processed]]]] property of the document information item in the XML Information Set. ;; Note that this attribute only exposes the information set property. Its value does ''not'' indicate whether the document is [Q@en[complete]] or not, or valid or not. In particular, modifications to the DOM tree does not affect the value of this attribute. @@ ISSUE: Relationship between the [CODE(DOMm)@en[[[normalizeDocument]]]] method and this attribute. The type of this attribute is [CODE(IDL)@en[[[boolean]]]]. This attribute is read-write. The getter [['''MUST''']] return the value. On setting, if the [CODE(DOMi)@en[[[Document]]]] is read-only, then a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] [['''MUST''']] be thrown. Otherwise, it [['''MUST''']] set the value to the new value. It is expected that if the [CODE(DOMi)@en[[[Document]]]] is created from an XML information set, then the [CODE(InfoProp)@en[[[all declarations processed]]]] property, if any, is mapped to this attribute. * Extension to the [CODE(DOMi)@en[DocumentTraversal]] interface [13] The [DFN@en[[CODE(DOMm)@en[[[manakaiCreateSerialWalker]]]] method]] creates and returns a new [CODE(DOMi)@en[[[SerialWalker]] object. This method takes four parameters: [CODE(DOMp)@en[[[root]]]], [CODE(DOMp)@en[[[whatToShow]]]], [CODE(DOMp)@en[[[filter]]]], and [CODE(DOMp)@en[[[entityReferenceExpansion]]]]. The [DFN@en[[CODE(DOMp)@en[[[root]]]] parameter]] is the node that will serve as the root for the [CODE(DOMi)@en[[[SerialWalker]]]]. It is a [CODE(DOMi)@en[[[Node]]]]. The [CODE(DOMp)@en[[[whatToShow]]]] flags and the [CODE(DOMi)@en[[[NodeFilter]]]] are not considered when setting this value; any node type will be accepted as the [CODE(DOMp)@en[[[root]]]]. The [CODE(DOMa)@en[[[currentNode]]]] of the created [CODE(DOMi)@en[[[SerialWalker]]]] is initialized to the [CODE(DOMp)@en[[[root]]]] [CODE(DOMi)@en[[[Node]]]], whether or not it is visible. The [CODE(DOMp)@en[[[root]]]] functions as a stopping point for traversal method that look upwards in the document structure, i.e. [CODE(DOMm)@en[[[nextNode]]]]. The [CODE(DOMp)@en[[[root]]]] [['''MUST NOT''']] be [CODE(IDL)@en[[[null]]]]. If it is, then a [CODE(DOMc)@en[[[NOT_SUPPORTED_ERR]]]] exception [['''MUST''']] be thrown. The [DFN@en[[CODE(DOMp)@en[[[whatToShow]]]] parameter]] is the flags that specify which node types may appear in the logical view of the tree presented by the [CODE(DOMi)@en[[[SerialWalker]]]]. It is an [CODE(IDL)@en[[[unsigned short]]]]. The set of the flags are defined in the [CODE(DOMi)@en[[[NodeFilter]]]] interface. They can be combined using the binary [CODE@en[[[OR]]]] operation. The [DFN@en[[CODE(DOMp)@en[[[filter]]]] parameter]] is the [CODE(DOMi)@en[[[NodeFilter]]]] to be used with the created [CODE(DOMi)@en[[[SerialWalker]]]]. If [CODE(IDL)@en[[[null]]]] is set, then no filter is used. The [DFN@en[[CODE(DOMp)@en[[[entityReferenceExpansion]]]] parameter]] parameter is the [CODE(DOMa)@en[[[expandEntityReferences]]]] flag of the created [CODE(DOMi)@en[[[TreeWalker]]]]. It is a [CODE(IDL)@en[[[boolean]]]] value. If it is set to [CODE(IDL)@en[[[true]]]], then the contents of the [CODE(DOMi)@en[[[EntityReference]]]] nodes ''are'' presented in the logical view. Otherwise, the contents of the [CODE(DOMi)@en[[[EntityReference]]]] nodes are ''not'' presented in the logical view. The method returns a [CODE(DOMi)@en[[[SerialWalker]]]]. It [['''MUST''']] be a new [CODE(DOMi)@en[[[SerialWalker]]]] with following attributes: - [CODE(DOMa)@en[[[currentNode]]]] is [CODE(DOMp)@en[[[root]]]]. - [CODE(DOMa)@en[[[expandEntityReferences]]]] is [CODE(DOMp)@en[[[entityReferenceExpansion]]]]. - [CODE(DOMa)@en[[[filter]]]] is [CODE(DOMp)@en[[[filter]]]]. - [CODE(DOMa)@en[[[root]]]] is [CODE(DOMp)@en[[[root]]]]. - [CODE(DOMa)@en[[[whatToShow]]]] is [CODE(DOMp)@en[[[whatToShow]]]]. * Extension to the [CODE(DOMi)@en[Element]] interface ** Element type accessor [12] The [DFN@en[[CODE(DOMm)@en[[[manakaiElementTypeMatch]]]] method]] returns whether the [CODE(DOMi)@en[[[Element]]]] belongs to the specified element type or not. This method takes two parameters: [CODE(DOMp)@en[[[namespaceURI]]]] and [CODE(DOMp)@en[[[localName]]]]. The [CODE(DOMp)@en[[[namespaceURI]]]] parameter is a [CODE(DOMi)@en[[[DOMString]]]]. It represents the namespace URI of the element type to test. Both [CODE(IDL)@en[[[null]]]] and an empty string represents the null namespace as in the [CODE(DOMp)@en[[[namespaceURI]]]] parameters of other similar methods. The [CODE(DOMp)@en[[[localName]]]] parameter is a [CODE(DOMi)@en[[[DOMString]]]]. It represents the local name of the element type to test. This method returns a [CODE(IDL)@en[[[boolean]]]] value. This method [['''MUST''']] return [CODE(IDL)@en[[[null]]]] if and only if: - The [CODE(DOMi)@en[[[namespaceURI]]]] of the [CODE(DOMi)@en[[[Element]]]] is [CODE(IDL)@en[[[null]]]], the [CODE(DOMp)@en[[[namespaceURI]]]] parameter is set to either [CODE(IDL)@en[[[null]]]] or an empty string, and the [CODE(DOMp)@en[[[localName]]]] parameter is set to the same value as the [CODE(DOMa)@en[[[manakaiLocalName]]]] attribute of the [CODE(DOMi)@en[[[Element]]]], or - The [CODE(DOPMp)@en[[[namespaceURI]]]] parameter is set to a non-empty [CODE(DOMi)@en[[[DOMString]]]] and it is equal to the [CODE(DOMi)@en[[[namespaceURI]]]] of the [CODE(DOMi)@en[[[Element]]]] and the [CODE(DOMp)@en[[[localName]]]] parameter is set to the same value as the [CODE(DOMa)@en[[[manakaiLocalName]]]] attribute of the [CODE(DOMi)@en[[[Element]]]]. Otherwise, the method [['''MUST''']] return [CODE(IDL)@en[[[false]]]]. * Extension to the [CODE(DOMi)@en[NodeList]] and the [CODE(DOMi)@en[NamedNodeMap]] interfaces [8] The [DFN@en[[CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute]] contains whether the [CODE(DOMi)@en[[[NodeList]]]] or [CODE(DOMi)@en[[[NamedNodeMap]]]] is read-only or not. The type of this attribute is [CODE(IDL)@en[[[boolean]]]]. This attribute is read-only. = If the [CODE(DOMi)@en[[[NodeList]]]] or [CODE(DOMi)@en[[[NamedNodeMap]]]] is read-only attribute value of a [CODE(DOMi)@en[[[Node]]]], then the getter [['''MUST''']] return the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute value of the [CODE(DOMi)@en[[[Node]]]]. = Otherwise, the getter [['''MUST''']] return [CODE(IDL)@en[[[true]]]] unless otherwise specified. ;; For example, the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute of the [CODE(DOMa)@en[[[childNodes]]]] [CODE(DOMi)@en[[[NodeList]]]] of an [CODE(DOMi)@en[[[Element]]]] has same value as the [CODE(DOMa)@en[[[manakaiReadOnly]]]] of the [CODE(DOMi)@en[[[Element]]]], while the [CODE(DOMa)@en[[[manakaiReadOnly]]]] attribute of a [CODE(DOMi)@en[[[NodeList]]]] obtained by the [CODE(DOMm)@en[[[getElementsByTagNameNS]]]] method of that [CODE(DOMi)@en[[[Element]]]] is always exhibits [CODE(IDL)@en[[[true]]]]. ** Metadata accessor [18] The [DFN@en[[CODE(DOMa)@en[[[manakaiBaseURI]]]] attribute]] corresponding to the [CODE(InfoProp)@en[[[base URI]]]] property in the XML Information Set. It contains the base DOM URI of the [CODE(DOMi)@en[[[Element]]]], if it is set explicitly to it. ;; To obtain the computed base URI of the [CODE(DOMi)@en[[[Element]]]], use the [CODE(DOMa)@en[[[baseURI]]]] attribute of the [CODE(DOMi)@en[[[Node]]]] interface instead. The type of this attribute is [CODE(DOMi)@en[[[DOMString]]]]. This attribute is read-write. On getting, the base DOM URI [['''MUST''']] be returned if it is specified to the [CODE(DOMi)@en[[[Element]]]]. Otherwise, [CODE(IDL)@en[[[null]]]] [['''MUST''']] be returned. On setting, if the [CODE(DOMi)@en[[[Element]]]] is read-only, then the [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception [['''MUST''']] be thrown. Otherwise, if the new value is [CODE(IDL)@en[[[null]]]], then the explicit specification of the base URI of the [CODE(DOMi)@en[[[Element]]]] is unset. Otherwise, the new value is set as the base URI of the [CODE(DOMi)@en[[[Element]]]]. Note that no lexical checking is performed on the new value. ;; The [CODE(DOMa)@en[[[manakaiBaseURI]]]], which is analogue to the [CODE(InfoProp)@en[[[base URI]]]] property, is independent from the [CODE(XMLa)@en[[[xml]]:[[base]]]] attribute. Setting the [CODE(DOMa)@en[[[manakaiBaseURI]]]] does not affect to the [CODE(XMLa)@en[[[xml]]:[[base]]]] or any other base URI sources and vice versa. * Extension to the [CODE(DOMi)@en[Attr]] interface ** Setter extension [19] The [DFN@en[[CODE(DOMa)@en[[[specified]]]] attribute]] is now read-write. On setting, if the [CODE(DOMi)@en[[[Attr]]]] is read-only, then an [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception [['''MUST''']] be thrown. Otherwise, the new value [['''MUST''']] set as the [CODE(DOMa)@en[[[specified]]]] flag of the [CODE(DOMi)@en[[[Attr]]]], except when the [CODE(DOMa)@en[[[ownerElement]]]] of the [CODE(DOMi)@en[[[Attr]]]] is [CODE(IDL)@en[[[null]]]], in which case the [CODE(DOMa)@en[[[specified]]]] flag [['''MUST''']] be set to [CODE(IDL)@en[[[true]]]] (if not yet) nevertheless the new value. ;; Note that setting [CODE(DOMa)@en[[[specified]]]] flag to [CODE(IDL)@en[[[false]]]] might make the serialized representation of the [CODE(DOMi)@en[[[Document]]]] inconsistent with the [CODE(DOMi)@en[[[Document]]]] itself. [20] The [DFN@en[[CODE(DOMa)@en[[[isId]]]] attribute]] is now read-write. On setting, if the [CODE(DOMi)@en[[[Attr]]]] is read-only, then an [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception [['''MUST''']] be thrown. Otherwise, the flag that represents whether the [CODE(DOMi)@en[[[Attr]]]] is a user-determined ID attribute or not [['''MUST''']] be set to the new value. ;; Setting [CODE(IDL)@en[[[false]]]] to this attribute does not make the [CODE(DOMi)@en[[[Attr]]]] non-[CODE(XML)@en[[[ID]]]] if the [CODE(DOMi)@en[[[Attr]]]] is marked as an [CODE(XML)@en[[[ID]]]] by other mean than the user-determined [CODE(XML)@en[[[ID]]]] flag, e.g. by DTD attribute definition. ** Attribute type accessor [21] The [DFN@en[[CODE(DOMa)@en[[[manakaiAttributeType]]]] attribute]] contains the declared type of the [CODE(DOMi)@en[[[Attr]]]]. The type of this attribute is [CODE(IDL)@en[[[unsigned short]]]]. This attribute is read-write. ;; This attribute corresponding to the [CODE(InfoProp)@en[[[attribute type]]]] property of an attribute information item in the XML Information Set. The getter [['''MUST''']] return the declared type of the [CODE(DOMi)@en[[[Attr]]]]. It is expected that a constant in the [CODE(DOM)@en[[[DeclaredValueType]]]] constant group is returned. If no declared type is explicitly set, then [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]] [['''MUST''']] be returned. On setting, if the [CODE(DOMi)@en[[[Attr]]]] is read-only, then an [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] exception [['''MUST''']] be thrown. Otherwise, the new value [['''MUST''']] be set as the attribute value. It is expected that a constant in the [CODE(DOM)@en[[[DeclaredValueType]]]] constant group is set to the attribute, though it is not checked by the attribute. * New configuration parameters @@ [14] [CODE(URI)@en[[[http://suika.fam.cx/www/2006/dom-config/strict-document-children]]]] * New language binding See [[DOM Perl Binding]] * memo