|
Posted by Steven N. Hirsch on April 15, 2006, 1:47 pm
Please log in for more thread options
edward.kawas@gmail.com wrote:
> Hi,
>
> I am using LibXML to create an xml document. I am also using
> namespaces.
>
> The problem that i am running into is that the document that i am
> creating has the namespace declaration at each element.
>
> For instance,
>
> <foo:A xmlns:foo="http://www.www.com/foo">
> <foo:B xmlns:foo="http://www.www.com/foo"> blah blah blab </foo:B>
> <foo:C xmlns:foo="http://www.www.com/foo"> blah blah blab </foo:C>
> </foo:A>
>
> And I want the following:
> <foo:A xmlns:foo="http://www.www.com/foo">
> <foo:B> blah blah blab </foo:B>
> <foo:C> blah blah blab </foo:C>
> </foo:A>
>
> How can i achieve this?
Just a WAG, but try something like this on the top element before
writing it out:
my $attr = $dom->createAttributeNS( '', 'dummy', '' );
$dom->getDocumentElement()->setAttributeNodeNS( $attr );
I solved a slightly different namespace-related problem by doing so.
Steve
|