Given this XML:
I'm using the following code to determine if the root element is 'catalog' or not.
This works fine for a <catalog> file, but I also need to determine other file types by reading the root element. Does anyone know of a method using XML::LibXML (or similar) module that would return the name of the root element?
Hi All,
I am looking for a awk/shell which can find an element named REFERENCE in a XML file and check whether it is empty or not.
If there is no value in the REFERENCE element then correspondingly move the file to some other folder.
The Unix server is AIX version 4.
Any inputs... (9 Replies)
Hi All
Can someone please help me with this awk to search an element in a XML file with a particular value and then change the root element.
Thanks & Regards
Karan (9 Replies)
I have a rather large file with XML-style content. Each line contains one full XML entry. For example:
1:<Message><DNIS>1234</DNIS><UCID>3456</UCID><TransferGroup>XYZXYZ</TransferGroup></Message>
2:<Message><DNIS>9999</DNIS><UCID>2584</UCID><TransferGroup>ABCABC</TransferGroup></Message>... (1 Reply)
Hi, I would need to read an xml element from an xml file to a local variable. Please could you help me with a shell script to get so? Considering that I have a file called file.xml like below:
<header>
<description>This is the description</description>
<content>This is the... (2 Replies)
hi experts:
i am using xslt to transform xml in shell.
But can not find root node of source xml, if i remove the naming space definition in source xml, it works fine.
So our the question is how to let xslt know the naming space of srouce xml file?
Thanks for your kindly help in... (0 Replies)
Any help to extract the root element from an XML file will be appreciated.
Example: test.xml
<?xml version="1.0" encoding="utf-8" ?>
<TestXMLMessage>
<TestRec>
<ID>1000</ID>
</TestRec>
</TestXMLMessage>
Wanted to extract the TestXMLMessage.
Regards,
Chari (6 Replies)
Hi,
I'm trying to write a script for some xml file handling, but I'm not getting too far with it.
I've got the following xml content
<?xml version="1.0" encoding="UTF-8"?>
<Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<Operation name="OPER1">
<Action name="ACTION1">... (2 Replies)
I want to check if every <Part> element has corresponding <Description> in this sample XML.
....<Lot Of XML>
<Inv lineNumber="2">
<Item>
... (4 Replies)
HI
I am looking for a easy way to merge 2 xml files like the following
file 1: will have a structure like this
<Group GID="TOTO" NAME="TOTO" UNITS="1.0">
<Property NAME="Id" VALUE="TOTO"/>
<Property NAME="Currency" VALUE="USD"/>
<Group... (6 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)