[xml] Namespaces and attributes



 Hello,

 It is certainly a dumb question, but I can't manage to
get namespaces nodes from attributes.
 My understanding was that the namespace could be retrieved
in attr->ns. 
 Here you find a little test I made with xmllint :

[desrefa ldiv85 ~]$ cat test.xml
<?xml version="1.0" ?>
<root xmlns:ns1="urn:namespace1">
   <ns1:bar>Hello</ns1:bar>
   <child ns1:att="foo"/>
</root>
[desrefa ldiv85 ~]$ xmllint --debug test.xml 
DOCUMENT
version=1.0
URL=test.xml
standalone=true
  ELEMENT root
    namespace ns1 href=urn:namespace1
    TEXT
      content=    
    ELEMENT ns1:bar
      TEXT
        content=Hello
    TEXT
      content=    
    ELEMENT child
      ATTRIBUTE att
        TEXT
          content=foo
    TEXT
      content= 

  I'm sure i'm missing something but what ?

        Fabrice
-- 
Fabrice Desré - France Telecom R&D/DMI/GRI
Tel: +(33) 2 96 05 31 43
Fax: +(33) 2 96 05 32 86




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