639 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
2
answers
124
views
Use xmlstarlet and XPath to find/replace HTML entities in an XML node
I have content in the XML node <content type='html'> which uses the HTML entities < and > for < and > , i.e. in input.xml:
<?xml version='1.0' encoding='utf-8'?>
<...
1
vote
1
answer
74
views
Use xmlstarlet to remove node if it contains a certain node
I'm trying to remove all the comments from an XML export of a Blogger blog. This involves finding and deleting each <entry> that contains a child node of <blogger:type>COMMENT</blogger:...
0
votes
1
answer
104
views
Is it possible to edit the text or HTML contents of an XML node using xmlstarlet?
The answer to my earier question How do I access an XML node that uses quote marks with xmlstarlet? shows how to access a node using the namespace, and in that case, deleting the entire node.
...
1
vote
1
answer
56
views
How do I access an XML node that uses quote marks with xmlstarlet?
I'm trying to learn how to use xmlstarlet 1.6.1 https://xmlstar.sourceforge.net and I can't find how to escape the quotes or otherwise get xmlstarlet to recognize <content type="html"> ...
1
vote
1
answer
47
views
Querying the current namespace using xmlstarlet
System: Debian 12
xmlstarlet --version
1.6.1
compiled against libxml2 2.9.14, linked with 20914
compiled against libxslt 1.1.35, linked with 10135
below a reduced debugging (example.xml) version of ...
0
votes
2
answers
61
views
No output from xmlstarlet, yet XPATH exists inside web inspector
System Info
alinuxchap@libertus-desktop:~ $ uname -a
Linux libertus-desktop 6.12.25+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025年04月30日) aarch64 GNU/Linux
alinuxchap@libertus-desktop:~ $ ...
0
votes
0
answers
83
views
xmlstarlet Sort XML based on value of element and return value of another element
I am trying to sort data using xmlstarlet.
Here is a sample of the XML I am querying.
<container>
<item>
<enabled>true</enabled>
<param name="label">...
2
votes
4
answers
120
views
xmlstarlet: Match / find by comments?
I have an XML file that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "https://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- ...
0
votes
4
answers
175
views
Selecting multple values from an XML document in linux shell
XML: https://raw.githubusercontent.com/dp247/Freeview-EPG/master/epg.xml
Example
<tv>
<programme channel="VirginRadio.uk" start="20250319220000 +0000" stop="...
1
vote
2
answers
63
views
How do I change the separator from a space to a comma with xmlstarlet?
I am parsing a file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<detection-run>
<wireless-network>
<SSID>
<...
0
votes
6
answers
177
views
Duplicate a section of XML in bash (via xmlstartlet, xmllint, xq, xslt, ...)
I have a valid XML file.
I would like to duplicate a tag with contents via linux shell command(s).
By duplication I mean: copy <x>...</x> entirely, then paste right after the original.
I ...
0
votes
2
answers
91
views
xmlstarlet fails to indent when formatting HTML?
So, I have this as input file, temp.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body>
&...
1
vote
1
answer
89
views
External DTD not parsing / 'entity not defined error'
I'm not getting the external DTD, a local file in the same folder, to work with a relative or an absolute path. It is not expanding the variable and gives an error in both Firefox and xmlstarlet.
...
1
vote
2
answers
121
views
Creating valid XML with xmlstarlet
I want to use xmlstarlet to select some records of a gigantic .xml file. My problem is, that I need the output to be valid XML.
Minimal example:
using xmlstarlet sel -t -c "//record[@type='TypeA']...
0
votes
1
answer
55
views
Updating an existing xml file elements with attributes and values using xmlstarlet
I want to write a script to iterate over each element "NewTempP" with attributes and child element and copy the structure to element "fig" as child element. "NewTempP" ...