Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: adding XML records using XML::Twig

by Loops (Curate)
on Jul 23, 2013 at 21:44 UTC ( #1045959=note: print w/replies, xml ) Need Help??


in reply to Re^2: adding XML records using XML::Twig
in thread adding XML records using XML::Twig

If you pass text as the third argument to insert_new_elt() it will be bracketed by the given element tags. However, if you pass a hash reference, you can instead change the elements attributes. So:
$insert->insert_new_elt('last_child','description', 'mydescription' ); # creates: <description>mydescription</description> $insert->insert_new_elt('last_child','description', { desc => 'mydescr +iption' } ); # creates: <description desc="mydescription" />

Replies are listed 'Best First'.
Re^4: adding XML records using XML::Twig
by Anonymous Monk on Jul 24, 2013 at 02:01 UTC
    How to get to <sites> <site info="123"> <description> <descrip descrip1="abc" descrip2="def"/> </description> </site> </sites> Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1045959]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-11-27 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?