It was there even without installing as it is part of the basic libxml2-utils package here. It too seems that xmllint has a more complete degree of conformance to the XPATH-Specification than the other 2 tools.
Seems to be not the version, but just the choice of features at compile time:
Hmm. Wrong. --xpath juest does not work with the old version.
However this one even works within the ancient debian:
Resulting in this:
Now strip of the unnecessary junk around the value:
...with the following being a bit more general(using positive lookahead and lookbehind to require > berfore the pattern and < after)...
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
Gathering these suggestions together with the call to the older version of xmllint (posted by stomp) and adding xml2 to process the modified XML (posted by greet_sed):
producing:
Observations:
1) the code for the early xmllint and xml2 need additional work, perl, awk, grep, etc. to isolate the string of interest.
2) A few of the codes (the ones that have a pe afterwards, seem to omit the trailing newline -- not an error, just something to be noted.
Hi ,
I have input file as XML. following are input data
#complex.xml
<?xml version="1.0" encoding="UTF-8"?>
<TEST_doc xmlns="http://www.w3.org/2001/XMLSchema-instance">
<ENTRY uid="123456">
<protein>
<name>PROT001</name>
<organism>Human</organism>
... (1 Reply)
Hello,
Hope you are doing fine. I have an log file which looks like as follows:
Some junk text1
Date: Thu Mar 15 13:38:46 CDT 2012 DATA SENT SUCCESSFULL:
Some jun text 2
Date: Thu Mar 15 13:38:46 CDT 2012 DATA SENT SUCCESSFULL: ... (3 Replies)
Hi,
I need to capture all the attributes with delete next to it. The source XML file is attached.
The output should contain something like this below:
Attributes = legacyExchangeDN
Action = Delete
Username = Hero Joker
Loginid = joker09
OU =... (4 Replies)
Hello All,
I want to write a shell script for extracting a content from a xml file
the xml file looks like this:
<Variable name="moreAxleInfo">
<type>
<Table>
<type>
<NamedType>
<type>
<TypeRef... (11 Replies)
Hi ,
I have one xml file contains more than 60 lines. I need to extract some details from the file and store it in new file.Not the whole file
Please find the xml file below:
<?xml version="1.0" encoding="UTF-8"?>
<DeploymentDescriptors xmlns="http://www.tibco.com/xmlns/dd">
... (6 Replies)
Hi,
Within a UNIX shell script I need to extract a value from an XML field. The field will contain different values but will always be 6 digits in length. E.g.:
<provider-id>999999</provider-id>
I've tried various ways but no luck. Any ideas how I might get the provider id (in this case... (2 Replies)
I have some xml files that got created by exporting a website from RedDot. I would like to extract the cost,
course number, description, and meeting information.
<?xml version="1.0" encoding="UTF-16" standalone="yes" ?>
- <PAG PAG0="3AE6FCFD86D34896A82FCA3B7B76FF90" PAG3="525312"... (3 Replies)