Hi,

  I'm trying to place a comment directly after the XML declaration using 
XML::LibXML,
But cannot seem to manage, always receiving error: 

setDocumentElement: ELEMENT node required at .../LibXML.pm line 1393

What I would like:

<?xml version="1.0" encoding="utf-8">
<!-- test comment -->
<products>
  <field>testing</field>
</products>

My relevant code thus far:

My $dom = XML::LibXML::Document->new( "1.0", "UTF-8");
My $root =  XML::LibXML::Comment->new( "test comment" );
$dom->setDocumentElement($root);


Any help would be greatly appreciated. I'm kinda stuck with using XML::LibXML 
though.

John

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to