Re: [xml] Namespaces! Agh!



Would it make sense to add a #define XML_NS_NULL (-1) for that purpose and
handle it respectively? Still not nice though.

Stefan

On 9:34:38 pm 01/07/2006 Nic James Ferrier <nferrier tapsellferrier co uk>
wrote:
Ok. Here's something I don't understand about namespaces (libxml2 in
python):

    dom = libxml2.newDoc("1.0")

    root = dom.newChild(None, "root", None)
    ns = root.newNs("http://www.tfnet.co.uk/somenamespace";, "ns")
    root.setNs(ns)

    node = root.newChild(ns, "element", None)
    node.newChild(None, "child", None)


And the output is:

   <root xmlns:ns="http://www.tfnet.co.uk/somenamespace";>
     <ns:element>
       <ns:child/>
     </ns:element>
   </root>

And the bit I don't understand is why the child element is marked with
the ns namespace.


Can anyone explain this?

--
Nic Ferrier
http://www.tapsellferrier.co.uk   for all your tapsell ferrier needs
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml




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