A validator for XML files.

learn more… | top users | synonyms

8
votes
5answers
48k views

Parse XML to get node value in bash script?

I would like to know how I can get the value of a node with the following paths: config/global/resources/default_setup/connection/host config/global/resources/default_setup/connection/username ...
5
votes
1answer
2k views

xmllint shell not showing number from count xpath expression?

I am using xmllint's interactive shell on cygwin. I would like to count the number of nodes, but xmllint doesn't seem to behaving as I expect: $> cat test.xml <?xml version="1.0"?> ...
3
votes
1answer
39 views

Problem with encoding in shell script

I have the following code: #!/bin/bash task=$1 xml=$(curl -sL "http://login:pass@server.com/issues/$task.xml") id=$(xmllint --xpath '//issue/id/text()' --format - <<<"$xml") name=$(xmllint ...
3
votes
2answers
11k views

xmllint display values of more than 1 attributes in single execution

I am using xmllint to parse xml file which has several tags and each tag has several attributes. Sample structure as shown below: <root> <child attr1="abc" attr2="def" attr3="ghi" /> ...
2
votes
2answers
385 views

xmllint displays value of second attribute if first one matches

my xml looks like <list1> <list2 id="abc" value="yes"></list2> <list2 id="xyz" value="no"></list2> <list2 id="def" value="yes"></list2> ...
2
votes
0answers
86 views

How to count nodes and get attribute value without using xpath

Currently I have a shell script like this: LOGIN=`curl 'https://www.ponta.jp/u/LWAS900/SLWAS900010.htm' -sS | grep '<input type="hidden" name\|<form\|</form'` for i in $(seq $(printf ...
2
votes
2answers
63 views

Strip attribute name from result set?

I have a HTML document that looks (when oversimplified) like this: <html> <body> <a href="...">...</a> <a href="...">...</a> <a ...
1
vote
1answer
17k views

Get Node value from a XML using xmllint

I have a xml called Det.xml like this : <?xml version="1.0" encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> ...
1
vote
1answer
38 views

Validate a list of xml files

I'd like to validate a list of xml files against a schema, and only be notified of failures. This command seems to work, but the last grep command has no effect: find -iname "*.xml" | xargs xmllint ...
1
vote
1answer
81 views

Retrieve attribute value from xml with namespaces using xmllint

I want to retrieve attribute value, using xpath option (without using xmllint' shell). my xml: <?xml version="1.0" encoding="UTF-8"?> <XML> <hhi:Elem ...
1
vote
1answer
7k views

XML parsing using xmllint and customizing the output

I have xml file (say input.xml) of the following schema: <?xml version="1.0"?> <TagA> <TagB> <File Folder="FOLDER1M\1" File="R1.txt" /> </TagB> ...
1
vote
1answer
59 views

How do I write the contents of an XMLLint --shell query?

I'm using xmllint --shell to inspect a very large XML file. I've written an XPath query that returns the results that I want, but in order to view and save the results, I'm having to cd to each node ...
1
vote
1answer
2k views

How do I get a list of the values of matching attributes using xmllint and xpath?

I'm trying to use xmllint to parse names of Solr cores from the configuration file. This works: xmllint --xpath /solr/cores/core/@name solr.xml |grep -Po '(?<=name=")[a-z-]+(?=")' And it returns ...
0
votes
3answers
61 views

How can I escape special characters in a sed “sub-command”?

I'm using xmllint --shell on a large XML file, and using the write command to write out an XML snippet to be used in testing. The snippet that gets written out needs a couple of lines from the ...
0
votes
2answers
38 views

Is there any tools that will let me check String length of XML Node

Am wondering if there are any tools that will do this: Exmaple XML: <node1> <Data> <Unique>123456789-1234567891</Unique> </Data> </node1> What i was hoping ...
0
votes
0answers
44 views

Downgrade libxml2 on RedHat 6.7

In this case we have two servers with different version of RedHat: 6.6 and 6.7. The libxml2 version is: [root@Redhat_6.6 ~]$ rpm -qa |grep -i libxml libxml2-python-2.7.6-17.el6_6.1.x86_64 ...
0
votes
0answers
56 views

How to get the version of xmllint installed?

When I run: $ xmllint --version xmllint: using libxml version 20706 But there is no such version http://www.xmlsoft.org/news.html I need to identify what version is in use according to homepage ...
0
votes
1answer
183 views

Parsing xml into array using xmllint

I have xml file with multiple <db> elements, I need to extract attributes from each node and do some work on them. IS it possible to load them to array, using ksh and xmllint ? This is what I ...
0
votes
2answers
433 views

How to format xml attributes, not just elements

How do you format an XML document to make it easy to read element attributes? I have a xml based webservice that returns one or two elements, but with hundreds of attributes. As I'm doing ...
-1
votes
1answer
94 views

how can i fetch a value from a text which is an incomplete xml file and then store it in a variable

I am having an issue while formatting an incomplete XML file in to a proper tagged XML, so that I can easily fetch the XML value inside a tag from it. Output text is like this: Input parameters ...