Re: [xml] how to add namespace-less node in python



On Sat, Dec 20, 2003 at 04:22:47PM -0700, John Fleck wrote:
On Sat, 2003-12-20 at 12:52, Hannu Krosing wrote:
Thanks!

Any idea why it is done this way ?


I'm no expert on this, but my guess it's because of the following in the
namespace spec[1]:

 5.2 Namespace Defaulting
 A default namespace is considered to apply to the element where it is
 declared (if that element has no namespace prefix), and to all elements
 with no prefix within the content of that element.

So if I'm reading the spec correctly (please, spec wizards correct me if
I'm wrong) it looks as though your <title/> and <a:title/> are
equivalent, because even without the "a:" the default namespace applies.

  Well not really. 
The reason the API got done that way is historical. Usually child of an
element are in the same namespace. In perspective it is confusing but
I really can't change the semantic of that call at this point and as
John pointed out previously, there is other ways to build the tree
anyway.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]