I want to edit the value of the node "title" in the following XML file, using XMLStarlet. Only the title node which is a child node of locale with attribute name="de-DE" should be edited.
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://apple.com/itunes/importer" version="software5.4">
<software>
<software_metadata app_platform="ios">
<versions>
<version string="1.1.1">
<locales>
<locale name="de-DE">
<title>title_DE</title>
</locale>
<locale name="en-US">
<title>title_EN</title>
</locale>
</locales>
</version>
</versions>
</software_metadata>
</software>
</package>
I tried the following command, but it does nothing:
xml ed -N x="http://apple.com/itunes/importer" -u '/x:package/x:software/x:software_metadata/x:versions/x:version/x:locales/x:locale[@name='de-DE']/x:title' -v 'new titel' metadata.xml
Using the same XPath query for selecting works fine:
xml sel -N x="http://apple.com/itunes/importer" -t -v "/x:package/x:software/x:software_metadata/x:versions/x:version/x:locales/x:locale[@name='de-DE']/x:title" metadata.xml
Does anybody know why selecting is working but editing is not?