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::LibXML::Comment(3) 				User Contributed Perl Documentation				   XML::LibXML::Comment(3)

NAME
XML::LibXML::Comment - XML::LibXML Comment Class SYNOPSIS
use XML::LibXML; # Only methods specific to Comment nodes are listed here, # see XML::LibXML::Node manpage for other methods $node = XML::LibXML::Comment->new( $content ); DESCRIPTION
This class provides all functions of XML::LibXML::Text, but for comment nodes. This can be done, since only the output of the node types is different, but not the data structure. :-) METHODS
The class inherits from XML::LibXML::Node. The documentation for Inherited methods is not listed here. Many functions listed here are extensively documented in the DOM Level 3 specification (<http://www.w3.org/TR/DOM-Level-3-Core/>). Please refer to the specification for extensive documentation. new $node = XML::LibXML::Comment->new( $content ); The constructor is the only provided function for this package. It is required, because libxml2 treats text nodes and comment nodes slightly differently. AUTHORS
Matt Sergeant, Christian Glahn, Petr Pajas VERSION
2.0018 COPYRIGHT
2001-2007, AxKit.com Ltd. 2002-2006, Christian Glahn. 2006-2009, Petr Pajas. perl v5.16.3 2013-05-13 XML::LibXML::Comment(3)
All times are GMT -4. The time now is 11:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy