• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 942
  • Last Modified:

Generate xml file using perl

Are there any good examples which show how to generate xml file using perl.
0
Anu2117
Asked:
Anu2117
3 Solutions
 
kawasCommented:
I really like using LibXML because it is w3c standards compliant. Tutorial @ http://www.xml.com/pub/a/2001/11/14/xml-libxml.html
0
 
Adam314Commented:
You could print the XML directly... eg:
  open(my $out, "file.xml") or die $!;
  print $out "<xml><element key=\"value\">some content</element></xml>\n";
  close($out);
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
kawasCommented:
the problem (in my (humble) opinion) with printing it directly is that if you provide text content to a node, then it wont be escaped appropriately.
0
 
Adam314Commented:
I agree, printing directly is not always the best solution.  But there are cases where it is useful.
0
 
Anu2117Author Commented:
Thanks guys.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now