Sponsored Content
Full Discussion: XML and UNix ???
Top Forums Shell Programming and Scripting XML and UNix ??? Post 302433788 by ad23 on Wednesday 30th of June 2010 01:45:29 PM
Old 06-30-2010
Question XML and UNix ???

Hello Everyone!!!

I have a list of XML files, in different directories, the structure for which is:
Code:
<Data>
           <Info>
                    <a> some text </a>
                    <b> some text </b>
                    <c> 3000 </c>
           </Info>
           <Info>
                    <a> some text </a>
                    <b> some text </b>
                    <c> 3000 </c>
           </Info>
           <Info>
                    <a> some text </a>
                    <b> some text </b>
                    <c> 3000 </c>
           </Info>
<Data>

I have many of these xml files in a directory structure like :

/abc/001/info.xml
/abc/002/info.xml
/abc/003/info.xml
/abc/004/info.xml

The value for node <c> 3000 </c> is same in one file, but is different for each individual file. For example:
Code:
/abc/001/info.xml  ---------> <c>3000</c> every time it appears in the file
/abc/002/info.xml  ---------> <c>4000</c> every time it appears in the file
and so on

I want to find this <c> node's value for all the files.
Is it possible to just write/display this value (which appears multiple times in a file) once????

Thanks!

Last edited by ad23; 06-30-2010 at 05:12 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

XML to flat file in Unix

Hello, How can I take a file in XML format and convert it to a comma separated format? Is there any scripts or programs that can do this for Unix? I tried surfing the net for such an application, but everything seems to be for Windows OS. Any help or suggestions are greatly appreciated. ... (2 Replies)
Discussion started by: oscarr
2 Replies

2. UNIX for Advanced & Expert Users

XML parsers for UNIX

Hi, I'm looking for XML parsers for UNIX! Thanks in advance Tim (1 Reply)
Discussion started by: timvant
1 Replies

3. UNIX for Dummies Questions & Answers

XML and Unix

i wanted to add a child element child2 into a below xml . <parent1> <child1></child1> </parent1> like <parent1> <child1></child1> <child2></child2> </parent1> What is the best way to do this using unix commands. I donot want to create a temp file.... cat original |... (3 Replies)
Discussion started by: sehgalniraj
3 Replies

4. UNIX for Dummies Questions & Answers

XML Translator to run in UNIX

Hello, newbie (non-techie) here. I'm a business analyst for a software company in the Bay Area. A project I just got assigned to involved researching for an enterprise version of a XML translator that will run on UNIX. I'm looking for something that won't be too costly to purchase as the... (4 Replies)
Discussion started by: Antsy
4 Replies

5. Linux

XML in unix

Can you please tell for some freeware unix based command line XML parser/tool which will check whether a particular XML corresponds to its XSD or not. please help immediately......... (15 Replies)
Discussion started by: infyanurag
15 Replies

6. Shell Programming and Scripting

Converter XML to PDF in Unix

Does anyone know of a lightweight freeware utility that will do the following?: 1) Input an XML file and XLS file 2) Do a transform 3) Then output a pdf file for Unix Platform. Thanks Andrea (3 Replies)
Discussion started by: andrea.giovanno
3 Replies

7. Programming

xml and c programming for unix

Does anyone can tell me what is the best way to post a xml request to a web service on C. I am using expat for parsing the response, but until now i build my xml request with a bunch of strcat functions, then connect to the port and send it that way. I am wondering if there are libraries or a... (3 Replies)
Discussion started by: loquito
3 Replies

8. Shell Programming and Scripting

passing an unix variable to an XML

I need help I have a unix command : VERSION=$(ls -d /vsn/v12.??.??.?? | sort | tail -1) when i do echo $VERSION, i get the exact value, i want. Now i want to use this variable and pass it to an xml. How can i do that? (1 Reply)
Discussion started by: samk
1 Replies

9. UNIX for Advanced & Expert Users

XML parsing by UNIX

Hi, I am new in shell scripting. i want to extract tag values in xml files by using shell script. my files like this: <cw: properties> <cw:std_properties> <tns: properties> <tns:name>AdminOutQueue</tns:name> <tns:type>String</tns:type> <tns:subtype>QueueName</tns:subtype> <tns:value... (25 Replies)
Discussion started by: arindam guha
25 Replies

10. Shell Programming and Scripting

Generating xml file from UNIX

i have a unix script which generates the csv file. the data in csv file is dynamic. how can i convert/move the data from csv file to xml. please suggest (1 Reply)
Discussion started by: archana25
1 Replies
XML::LibXML::XPathExpression(3) 			User Contributed Perl Documentation			   XML::LibXML::XPathExpression(3)

NAME
XML::LibXML::XPathExpression - XML::LibXML::XPathExpression - interface to libxml2 pre-compiled XPath expressions SYNOPSIS
use XML::LibXML; my $compiled_xpath = XML::LibXML::XPathExpression->new('//foo[@bar="baz"][position()<4]'); # interface from XML::LibXML::Node my $result = $node->find($compiled_xpath); my @nodes = $node->findnodes($compiled_xpath); my $value = $node->findvalue($compiled_xpath); # interface from XML::LibXML::XPathContext my $result = $xpc->find($compiled_xpath,$node); my @nodes = $xpc->findnodes($compiled_xpath,$node); my $value = $xpc->findvalue($compiled_xpath,$node); $compiled = XML::LibXML::XPathExpression->new( xpath_string ); DESCRIPTION
This is a perl interface to libxml2's pre-compiled XPath expressions. Pre-compiling an XPath expression can give in some performance benefit if the same XPath query is evaluated many times. "XML::LibXML::XPathExpression" objects can be passed to all "find..." functions "XML::LibXML" that expect an XPath expression. new() $compiled = XML::LibXML::XPathExpression->new( xpath_string ); The constructor takes an XPath 1.0 expression as a string and returns an object representing the pre-compiled expressions (the actual data structure is internal to libxml2). AUTHORS
Matt Sergeant, Christian Glahn, Petr Pajas VERSION
2.0008 COPYRIGHT
2001-2007, AxKit.com Ltd. 2002-2006, Christian Glahn. 2006-2009, Petr Pajas. perl v5.16.2 2012-10-22 XML::LibXML::XPathExpression(3)
All times are GMT -4. The time now is 02:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy