Re: [xml] namespaces redeclarations

On Tuesday 17 April 2007, Arne Van Theemsche wrote:

I use the perl interfaces to libxml2

I'm the current maintainer of it. XML::LibXML is not discussed here but on 
perl-xml listserv activestate com 

imagine I parse an xml like

<foo xmlns:ns2=>

and then i do a createElementNS("","bar2";) and an
appendChild on the "ns2:bar" I will end up in something like

 <foo xmlns:ns2=>
  <ns2:bar><bar2 xmlns=""/></ns2:bar>

Which is correct given your code.

this is syntax wise ok, but i would rather end up in something like

 <foo xmlns:ns2=>

is there a solution to this or am I just making problems for nothing? :)

yes, use createElementNS("","ns2:bar2";);

-- Petr Pajas

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