![]() |
![]() discuss |
![]() download |
![]() home |
|
|
DOM 1.0 - Conformance TestingAuthor :Nazmul IdrisDate : Jun 4 1999Links :
Copyright 1999 - 2006 Nazmul
Idris. All Rights Reserved.
|
We performed this test on the Sun Java2 Virtual Machine for Windows (JDK 1.2.1). The parsers are of the following versions:
| Description of test:
A DOM Node may contain other Node objects as its children. The Structure test determines whether parsers allow any Node object type to be a child of any other Node . In the DOM 1.0 recommendation there are many restrictions on what types of children Nodes a given Node type can have. Certain Node types may not have children at all and the following test does not use these Node types; it primarily tests Node types that can have children (Document, DocumentFragment, EntityReference, etc.). |
Document
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| Element | Yes | Yes | Yes | |
| ProcessingInstruction | Yes | Yes | Yes | |
| Commment | Yes | Yes | Yes | |
| DocumentType | n/a | n/a | n/a | n/a |
| Maximum of one Element | Yes | Yes | Yes | |
| deviations from recommendation | Text Node can be added to a Document object |
DocumentFragment
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| Element | Yes | Yes | Yes | |
| ProcessingInstruction | Yes | Yes | Yes | |
| Comment | Yes | Yes | Yes | |
| Text | Yes | Yes | Yes | |
| CDATASection | Yes | Yes | Yes | |
| EntityReference | Yes | Yes | Yes |
EntityReference
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| Element | Yes | Yes | Yes | |
| ProcessingInstruction | Yes | Yes | Yes | |
| Comment | Yes | Yes | Yes | |
| Text | Yes | Yes | Yes | |
| CDATASection | Yes | Yes | Yes | |
| EntityReference | Yes | Yes | Yes | |
Element
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| Element | Yes | Yes | Yes | |
| ProcessingInstruction | Yes | Yes | Yes | |
| Comment | Yes | Yes | Yes | |
| Text | Yes | Yes | Yes | |
| CDATASection | Yes | Yes | Yes | |
| EntityReference | Yes | Yes | Yes | |
Attr
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| Text | No | Yes | Yes | |
| EntityReference | No | Yes | Yes | |
| deviations from recommendation | Text and EntityReference objects can't be added to an Attr object |
ProcessingInstruction
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| no children | Yes | Yes | Yes | |
Text
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| no children | Yes | Yes | NO | |
| deviations from recommendation | Can add Element, ProcssingInstruction, Comment, Text, CDATASection, EntityReference to Text object |
CDATASection
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| no children | Yes | Yes | Yes | |
DocumentType *
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| no children | n/a | n/a | n/a | n/a |
Entity *
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| Element | n/a | n/a | n/a | n/a |
| ProcessingInstruction | n/a | n/a | n/a | n/a |
| Comment | n/a | n/a | n/a | n/a |
| Text | n/a | n/a | n/a | n/a |
| CDATASection | n/a | n/a | n/a | n/a |
| EntityReference | n/a | n/a | n/a | n/a |
Notation *
| can have child node: | Sun | IBM | DataChannel | OpenXML |
| no children | n/a | n/a | n/a | n/a |
* DocumentType, Entity, and Notation classes are not tested for their structure because they are declared in DTD (Document Type Definition).
| Description of test:
A Node can have 3 properties: nodeName, nodeValue, attributes. These 3 properties are different for each of the 12 Node types in DOM. The following test determines whether each of the 12 Node types contains the correct types of values in each property. |
In DOM 1.0, a Node object can have a type (eg, a Node can be an
element
node or an attribute node, etc.). There are 12 such predefined types
which
are listed in the table below:
| Node type: | Sun | IBM | DataChannel | OpenXML |
| ELEMENT_NODE = 1 | Yes | Yes | Yes | |
| ATTRIBUTE_NODE = 2 | Yes | Yes | Yes | |
| TEXT_NODE = 3 | Yes | Yes | Yes | |
| CDATA_SECTION_NODE = 4 | Yes | Yes | Yes | |
| ENTITY_REFERENCE_NODE = 5 | Yes | Yes | Yes | |
| ENTITY_NODE = 6 | n/a | n/a | n/a | n/a |
| PROCESSING_INSTRUCTION_NODE = 7 | Yes | Yes | Yes | |
| COMMENT_NODE = 8 | Yes | Yes | Yes | |
| DOCUMENT_NODE = 9 | Yes | Yes | Yes | |
| DOCUMENT_TYPE_NODE = 10 | n/a | n/a | n/a | n/a |
| DOCUMENT_FRAGMENT_NODE = 11 | Yes | Yes | Yes | |
| NOTATION_NODE = 12 | n/a | n/a | n/a | n/a |
The values of the properties: nodeName, nodeValue, and attributes vary according to the node type as follows:
Element
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = tagName | Yes | Yes | Yes | |
| nodeValue = null | Yes | Yes | Yes | |
| attributes = NamedNodeMap | Yes | Yes | Yes |
Attr
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = name of attribute | Yes | Yes | Yes | |
| nodeValue = value of attribute | Yes | Yes | Yes | |
| attributes = null | Yes | Yes | Yes |
Text
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = #text | Yes | Yes | Yes | |
| nodeValue = content of the text node | Yes | Yes | Yes | |
| attributes = null | Yes | Yes | Yes |
CDATASection
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = #cdata-section | Yes | Yes | Yes | |
| nodeValue = content of the CDATA Section | Yes | Yes | Yes | |
| attributes = null | Yes | Yes | Yes |
EntityReference
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = name of entity referenced | Yes | Yes | Yes | |
| nodeValue = null | Yes | Yes | Yes | |
| attributes = null | Yes | Yes | Yes |
ProcessingInstruction
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = target | Yes | Yes | Yes | |
| nodeValue = entire content excluding the target | Yes | Yes | Yes | |
| attributes = null | Yes | Yes | Yes |
Comment
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = #comment | Yes | Yes | Yes | |
| nodeValue = content of the comment | Yes | Yes | Yes | |
| attributes = null | Yes | Yes | Yes |
Document
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = #document | Yes | Yes | Yes | |
| nodeValue = null | Yes | Yes | Yes | |
| attributes = null | Yes | Yes | Yes |
DocumentFragment
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = #document-fragment | Yes | Yes | Yes | |
| nodeValue = null | Yes | Yes | Yes | |
| attributes = null | Yes | Yes | Yes |
Entity **
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = entity name | n/a | n/a | n/a | n/a |
| nodeValue = null | n/a | n/a | n/a | n/a |
| attributes = null | n/a | n/a | n/a | n/a |
DocumentType **
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = document type name | n/a | n/a | n/a | n/a |
| nodeValue = null | n/a | n/a | n/a | n/a |
| attributes = null | n/a | n/a | n/a | n/a |
Notation **
| has properties: | Sun | IBM | DataChannel | OpenXML |
| nodeName = notation | n/a | n/a | n/a | n/a |
| nodeValue = null | n/a | n/a | n/a | n/a |
| attributes = null | n/a | n/a | n/a | n/a |
** DocumentType, Entity, and Notation Node are not tested for their structure because they are declared in DTD (Document Type Definition).
| Description of test:
This test determines whether methods in the DOM interfaces (Document, Node, Element, etc.) throw the correct exceptions when these exceptional circumstances exist. By doing invalid things in the invocation of each method in each of the DOM interfaces, the following table was generated. |
Document interface:
createElement()
createCDATASection()
createProcessingInstruction()
createAttribute()
createEntityReference()
|
Node interface:
insertBefore()
replaceChild()
removeChild()
appendChild()
|
NamedNodeMap interface:
setNamedItem()
removeNamedItem
|
Element interface:
setAttribute()
removeAttribute()
setAttributeNode()
removeAttributeNode()
|
CharacterData interface:
substringData()
appendData()
insertData()
deleteData()
replaceData()
|
Text interface:
splitText()
|
*** NOT_SUPPORTED_ERR - This error is not tested because an HTML object is not created.
**** NO_MODIFICATION_ALLOWED_ERR - Could not create a Read-Only node for this testing.
***** DOMSTRING_SIZE_ERR - This error is not tested because DOMString is bound to the String type.
![]() |
![]() discuss |
![]() download |
![]() home |