Re: Namespace - Saving to a File
Paolo Casarini <[email protected]> Tue, 3 May 2005 22:23:45 +0200
| Newsgroups | gmane.comp.gnome.gdome |
|---|---|
| Message-ID | <[email protected]> |
Hi Chetan, On Tuesday, May 3, 2005, 7:45:09 AM, Chetan Raj wrote: > I still have the following doubts.... >>> libxml2 is correct. The namespace associated to a node is a different >>> thing from the namespace declared through the attribute xmlns on a >>> node. >>> The namespace you specify on the createDocument is the namespace >>> associated to the document element node, not the namespace declared on >>> it. > When Iassociate a namespace to a document element, wouldn't that > mean thatthe document element and all its children are under the > scope of theassociated namespace. In that sense, doesn't the > associated namespacebecome the default namespace for the element? Not exactly. The DOM is one of the easiest way to handle XML document but a DOM tree is not exactly an XML document. It's up to you to build a "correct" XML document, the DOM gives you only some interfaces to easily manage XML document in broad sense (also not valid). > If theassociation implies the default namespace, then wouldn't it > be betterfor createDocument to put the special xmlns attribute, > while itscreating the document element? It's not in the purpose of the createDocument to do that. Bye, Paolo. -- GPG key: 1024D/9C5AE886 2004-10-21 Paolo Casarini <[email protected]>