Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I select and edit an xml node with xmlstartlet?
    primarykey
    data
    text
    <p>Here I'm selecting the node:</p> <pre><code>$ xmlstarlet sel -t -c "/configuration/property[name='http.agent.name']"/value conf/nutch-default.xml &lt;value/&gt; </code></pre> <p>This doesn't edit it:</p> <pre><code>$ xmlstarlet edit "/configuration/property[name='http.agent.name']"/value -v 'test' conf/nutch-default.xml I/O warning : failed to load external entity "/configuration/property[name='http.agent.name']/value" </code></pre> <p>What would be an xmlstartlet command that does change the change? AFAIK -x is not supported in xmlstartlet yet.</p> <p>I'm working on <a href="http://www.webcitation.org/query?url=http://svn.apache.org/viewvc/nutch/branches/branch-1.3/conf/nutch-default.xml?view=markup&amp;date=2011-04-08" rel="nofollow">conf/nutch-default.xml</a></p> <pre><code>$ xmlstarlet ed --help XMLStarlet Toolkit: Edit XML document(s) Usage: xml ed &lt;global-options&gt; {&lt;action&gt;} [ &lt;xml-file-or-uri&gt; ... ] where &lt;global-options&gt; - global options for editing &lt;xml-file-or-uri&gt; - input XML document file name/uri (stdin otherwise) &lt;global-options&gt; are: -P (or --pf) - preserve original formatting -S (or --ps) - preserve non-significant spaces -O (or --omit-decl) - omit XML declaration (&lt;?xml ...?&gt;) -N &lt;name&gt;=&lt;value&gt; - predefine namespaces (name without 'xmlns:') ex: xsql=urn:oracle-xsql Multiple -N options are allowed. -N options must be last global options. --help or -h - display help where &lt;action&gt; -d or --delete &lt;xpath&gt; -i or --insert &lt;xpath&gt; -t (--type) elem|text|attr -n &lt;name&gt; -v (--value) &lt;value&gt; -a or --append &lt;xpath&gt; -t (--type) elem|text|attr -n &lt;name&gt; -v (--value) &lt;value&gt; -s or --subnode &lt;xpath&gt; -t (--type) elem|text|attr -n &lt;name&gt; -v (--value) &lt;value&gt; -m or --move &lt;xpath1&gt; &lt;xpath2&gt; -r or --rename &lt;xpath1&gt; -v &lt;new-name&gt; -u or --update &lt;xpath&gt; -v (--value) &lt;value&gt; -x (--expr) &lt;xpath&gt; (-x is not implemented yet) XMLStarlet is a command line toolkit to query/edit/check/transform XML documents (for more information see http://xmlstar.sourceforge.net/) $ xmlstarlet --version 1.0.1 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload