I modified gdome2 a bit so that some of the differences to the official recommendations are fixed. A patch is attached. On Thu, 25 Oct 2001, Tobias Peters wrote: > * setting DocumentType::nodeValue raises exception Fixed by this patch. Document, DocumentFragment, DocumentType, Element, Entity, EntityReference, Notation now ignore setting of nodeValue quietly. > * DocumentType::parentNode returns null when validating with external > dtd: > * DocumentType::nextSibling and DocumentType::previousSibling are > affected in the same way as DocumentType::parentNode Fixed. The libxml tree contains two xmlDtd nodes, one for the internal subset, and one for the external. Gdome2 chose to wrap the external subset dtd if it exists, which is not a physical part of the document and thus has no parent and no siblings. Changed so that the internal subset xmlDtd node is wrapped. Question: If there is an external subset Dtd, then there is also an internal subset Dtd (the <!DOCTYPE ...> declaration), isn't there? On Fri, 26 Oct 2001, I wrote: > look at this excerpt from the Document::createElement method: > > In addition, if there are known attributes with default values, Attr > > [p.51] nodes representing them are automatically created and attached > > to the element. Implemented by this patch, thanks to Daniel for telling me where to look. Interestingly, the description of Document::createElementNS does not contain this sentence. I asked on the w3c dom mailing list if this is by intention or an oversight. There, I also asked about the decision which exception to throw. But I don't know if I will get answers from the DOM working group. Someone asked a similar question about exceptions more than a week ago and did not receive a response. The following is not fixed: > * DocumentType::childNodes returns null > > The specification says on page 37, description of Node::childNodes: > > childNodes of type NodeList [p.43] , readonly > > A NodeList [p.43] that contains all children of this node. If > > there are no children, this is a NodeList containing no nodes. I tried to fix it by modifying gdome_xml_n_childNodes, gdome_xml_nl_item, gdome_xml_nl_length, but this gave segfaults that I have not further investigated, so I don't include these changes. The attached patch is compressed with bz2, and can be applied when inside the libgdome directory with -p1 Bye, Tobias
Attachment:
gdome2_dom-compliance.patch.bz2
Description: Binary data