Sponsored Content
Full Discussion: how to gen XML?
Top Forums Shell Programming and Scripting how to gen XML? Post 302308645 by ryanW on Sunday 19th of April 2009 11:36:55 PM
Old 04-20-2009
I need to generate the xml with content below, what is the method?
Response XML:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response scannerId="888888" success="true" userId="444" xmlns="404 - Not Found">
<locInfo>
<location>SHE </location>
<locType>P</locType>
<warehouse>MRT </warehouse>
<timeout>188</timeout>
</locInfo>
</response>

This is my current coding... but look like not a good method.

Code:
echo "Response XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>" >> testing.xml
echo "<response scannerId="239198" success="true" userId="123" xmlns="404 - Not Found">" >> testing.xml
echo "  <locInfo>" >> testing.xml
echo "  <location>SHE  </location>" >> testing.xml
echo "  <locType>P</locType>" >> testing.xml
echo "  <warehouse>MRT </warehouse>" >> testing.xml
echo "  <timeout>188</timeout>" >> testing.xml
echo "  </locInfo>" >> testing.xml
echo "</response>" >> testing.xml

I hope someone can teach me a good method to write this content to xml file...
thankx

Last edited by Yogesh Sawant; 04-20-2009 at 05:26 AM.. Reason: added code tags
 

2 More Discussions You Might Find Interesting

1. Programming

Problem with csv file gen from C++

Hi Frnds, I have a problem with csv file gen. Here is the description: My code genereates a csv file as output in which a particular column("OUTPUT NUMBER")contains a string value fetched from db. Now the problem is when i open this csv file the OUTPUT NUMBER column misses the zero("0")... (10 Replies)
Discussion started by: electroon
10 Replies

2. What is on Your Mind?

New-gen gaming consoles

I've been thinking of buying a gaming console. I've narrowed down to two options and of course they are Sony PS3 and XBOX 360. Both have equally good reviews. Most games are released for both PS3 as well as XBOX. I did search the forums for a similar thread and found this. The highest number of... (8 Replies)
Discussion started by: balajesuri
8 Replies
XML::Grove::AsCanonXML(3)				User Contributed Perl Documentation				 XML::Grove::AsCanonXML(3)

NAME
XML::Grove::AsCanonXML - output XML objects in canonical XML SYNOPSIS
use XML::Grove::AsCanonXML; # Using as_canon_xml method on XML::Grove objects: $string = $xml_object->as_canon_xml( OPTIONS ); # Using an XML::Grove::AsCanonXML instance: $writer = XML::Grove::AsCanonXML->new( OPTIONS ); $string = $writer->as_canon_xml($xml_object); $writer->as_canon_xml($xml_object, $file_handle); DESCRIPTION
"XML::Grove::AsCanonXML" will return a string or write a stream of canonical XML for an XML object and it's content (if any). "XML::Grove::AsCanonXML" objects hold the options used for writing the XML objects. Options can be supplied when the the object is created, $writer = XML::Grove::AsCanonXML->new( Comments => 1 ); or modified at any time before writing an XML object by setting the option directly in the `$writer' hash. OPTIONS
Comments By default comments are not written to the output. Setting comment to TRUE will include comments in the output. AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us SEE ALSO
perl(1), XML::Parser(3), XML::Grove(3). James Clark's Canonical XML definition <http://www.jclark.com/xml/canonxml.html> perl v5.16.3 1999-08-17 XML::Grove::AsCanonXML(3)
All times are GMT -4. The time now is 12:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy