The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
0answers
19 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
53 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
35 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 ...
0
votes
0answers
17 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
82 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 ...
1
vote
1answer
30 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
34 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 ...
2
votes
2answers
206 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> ...
-1
votes
1answer
61 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 ...
0
votes
2answers
374 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
vote
1answer
1k 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 ...
4
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"?> ...
8
votes
5answers
43k 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 ...
0
votes
1answer
14k 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
6k 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> ...
3
votes
2answers
10k 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" /> ...