CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
need help

 



ym_chaitu
Novice

Jun 21, 2010, 5:22 AM

Post #1 of 6 (906 views)
need help Can't Post

Hai
I have a small query regarding to xml reading and writng..

i have an xml like this

Code
<a value="5" note=2 > 
<b><c>hello</c></b>
</a>


now i need to add a new attribute to node a.

can any one help me how to do it..


rovf
Veteran

Jun 21, 2010, 9:39 AM

Post #2 of 6 (895 views)
Re: [ym_chaitu] need help [In reply to] Can't Post

XML::Parser?
XML::XPath?


ym_chaitu
Novice

Jun 21, 2010, 9:55 PM

Post #3 of 6 (880 views)
Re: [rovf] need help [In reply to] Can't Post

can u show a sample


rovf
Veteran

Jun 21, 2010, 10:35 PM

Post #4 of 6 (879 views)
Re: [ym_chaitu] need help [In reply to] Can't Post

Did you check the CPAN pages?


ym_chaitu
Novice

Jun 22, 2010, 1:49 AM

Post #5 of 6 (873 views)
Re: [rovf] need help [In reply to] Can't Post

checked but could not find the suitable example..

do u have one


rovf
Veteran

Jun 22, 2010, 4:36 AM

Post #6 of 6 (865 views)
Re: [ym_chaitu] need help [In reply to] Can't Post

No, because I am using XML::Simple for this purpose, and I didn't want to recommend this to you, because it's a bit tricky to configure when you want to create the XML text, but if you are interested in this, you can find a tutorial here: http://www.ibm.com/developerworks/xml/library/x-xmlperl1.html

Also, on second thought, I think it makes more sense to have a look at XML::Twig (including XML::Twig::Elt). On the CPAN page, you also find examples.

Maybe XML::Dumper is worth a look too.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives