zericm has asked for the wisdom of the Perl Monks concerning the following question:
All,
I have a need to create a new document and would like to do so with Twig. This right here works:
my $root = XML::Twig::Elt->new('project'); my $homePageProjectName = XML::Twig::Elt->new( projectName => $project +NameValue); $homePageProjectName->paste($root); print qq|<?xml version="1.0"?>|; $root->print;
and outputs this:
<?xml version="1.0"?><project><projectName>Test Project</projectName></project>Which works fine, I suppose, but I really want it to do this full on twig style, losing that quoted print statement above. What I'm trying accomplish here is to read from one xml file and then output two new files. I can do the parsing fine now (thanks monks) and can extract specific elements from the tree. The challange for me is creating the two new files.
Thanks,
Eric
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Twig Question: Create a new XML doc using twig?
by mirod (Canon) on Mar 23, 2009 at 08:41 UTC | |
Re: Twig Question: Create a new XML doc using twig?
by ramrod (Priest) on Mar 23, 2009 at 01:45 UTC | |
by GrandFather (Saint) on Mar 23, 2009 at 02:36 UTC |