This post originated from an RSS feed registered with Perl Buzz
by Cory Watson.
Original Post: XML::DOM - The Declaration
Feed Title: One Mo' Gin
Feed URL: http://www.onemogin.com/blog/feed
Feed Description: Thoughts on lots of things. Developer stuff mostly.
Took me a little while to find this today, so I thought I’d mention it for future reference.To add a declaration to a document created with XML::DOM, do the following:
my $decl = $doc->createXMLDecl(‘1.0′, ‘UTF-8′);
$doc->setXMLDecl($decl);Now the xml from the toString() will have a declaration! If only I could find something that would indent the XML…