Re: [xml] Namespaces and attributes



On Tue, Jun 26, 2001 at 11:33:53AM +0200, Fabrice DESRE - FT.BD/FTRD/DMI/GRI wrote:
 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. 

  right

[desrefa ldiv85 ~]$ xmllint --debug test.xml 
[...]
  I'm sure i'm missing something but what ?

  just that --debug don't show them, but there are generated:

(gdb) p *doc->children->children->next->next->next
$3 = {_private = 0x0, type = XML_ELEMENT_NODE, name = 0x80c66d0 "child", 
  children = 0x0, last = 0x0, parent = 0x80c62e8, next = 0x80c6510, 
  prev = 0x80c64b8, doc = 0x80c60d8, ns = 0x0, content = 0x0, 
  properties = 0x80c6750, nsDef = 0x0}
(gdb) p *doc->children->children->next->next->next->properties
$4 = {_private = 0x0, type = XML_ATTRIBUTE_NODE, name = 0x80c67a0 "att", 
  children = 0x80c67c8, last = 0x80c67c8, parent = 0x80c6678, next = 0x0, 
  prev = 0x0, doc = 0x80c60d8, ns = 0x80c63c8, atype = 0}
(gdb) p *doc->children->children->next->next->next->properties->ns
$5 = {next = 0x0, type = XML_NAMESPACE_DECL, 
  href = 0x80c6400 "urn:namespace1", prefix = 0x80c6438 "ns1"}
(gdb) 

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Sep 17-18 2001 Brussels Red Hat TechWorld http://www.redhat-techworld.com




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