Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [xmlstarlet]

Open source command line utility for XML file processing.

0
votes
1answer
30 views

Extract select match value of same contents in XML file

I using this command for below xml file. xmlstarlet sel -t -v '//channel[protected = "True"]/playlist_url' -nl file.xml and result; host.net/aa/vodpr host.net/aa/vodpr/con_tv_r.php Can I choose a ...
1
vote
1answer
58 views

How to extract selected value in XML

I would like to extract only a value from similar content XML file. Example; <?xml version="1.0" encoding="UTF-8" ?> <items> <channel> <title><![CDATA[*** text 1 text *...
0
votes
1answer
53 views

Set bash variables from XML tags

I have the following xml file <root> <deviceID>IO238470374109730497</devicdeID> <KeyValuePairs> <KeyValuePair> <BASE-URL>site.com</BASE-URL> &...
-4
votes
2answers
71 views

Extract content between tags which is having sub tag

Extract the desired content from the file using "xmlstarlet" or "sed" or "awk" or some similar tool. The process should refer the full name of the particular businessprocesses and then should just ...
0
votes
4answers
267 views

need to join only certain lines of a xml file together [duplicate]

I would like to transform this XML to where only certain lines are joined together. This is so I can later grep only specific lines. If this XML used attributes, then the data would already be in 1 ...
1
vote
1answer
90 views

Parsing 12,000+ XML files

I have a folder that contains 12,000+ XML files. I need to get a list of files within that folder that meet certain criteria. In the XML file there is a node called /BillingData/InvoiceLinesList/...
6
votes
1answer
229 views

how to massage or format html in order to parse with xmstarlet?

Do I first need to run html in the wild through something like jsoup? Not to make it valid in a human sense, might turn it to gibberish, but at least so that xmlstarlet can process the file? ...
1
vote
1answer
235 views

XmlStarlet xml to csv output as 'NaNNaNNaN'

I wrote a a query xmlstarlet sel -T -t -m badges/row -v "concat(@row, ',')" -n Badges.xml and the output is repeated as: NaNNaNNaN... for what is likely the amount of rows in the Badges.xml file. I ...
0
votes
2answers
198 views

Executing Command in Pipes

I need to understand why I am not able to execute the following. ls -d /data/VT60000* | xargs -IDIRECTORY find DIRECTORY -type f -iname RJ\*.xml | xargs -IFILE sh -c ' XML=$( xmlstarlet fo -D "FILE" )...
2
votes
1answer
907 views

Edit XML using xmlstarlet only in one subnode

When using the command: -bash-4.2$ xmlstarlet ed -u "/configurations/rules/rule/branch" -v 'DAVID' config.xml > final.xml I see that the output file was changed to DAVID, But it was changed ...
2
votes
1answer
308 views

How exactly does xmlstarlet move work

I want to move around elements in an xml document with xmlstarlet Specifically I want to make the following changes <parent> <before/> <span><a>blah</a></...
2
votes
1answer
441 views

Rename XML elements to a sequence

I was looking at a possible XML-based solution to another question. I'm aware of its accepted answer, which offers sed and python solutions. The given XML fragment is: <Names> <Name>...
0
votes
1answer
391 views

Insert a tag with a unique identifier into a XML

I'm able to add a new node with a custom fixed value to my XML file in this way, with xmlstarlet: xmlstarlet ed --subnode "/legge190/data/lotto" --type elem -n newsubnode \ -v "myvalue" But how to ...
2
votes
2answers
781 views

How to convert multi level xml to a single line containing all levels using XMLSTARLET

The sample XML looks like this: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <root> <level01> <field01>AAAAAAAAAAAAAAAAAAAA</field01> <field02>...
3
votes
2answers
555 views

Can I convert fields in XML to tags using xmlstarlet?

I want to convert fields in Tags to tags within that tag for example <book name="Data Structure" price="250" pages="350"/> To <book name="Data Structure"> <price>250</price&...
1
vote
1answer
1k views

Why isn't this XMLStarlet Query Working?

I'm trying to write a simple bash script that parses price info from the ebay developer API search results. Here's an example of XML search results for "Detective Comics 700": <...