[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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