I have this XML file:
<?xml version="1.0" encoding="UTF-8" ?>
<engineConfiguration xmlns="http://bla.com/engine/management/engineConfiguration">
<engineParameter>
<name>PORT_ID</name>
<value>47827</value>
</engineParameter>
<engineParameter>
<name>POS_PRINTER_PORT_ID</name>
<value>27001</value>
</engineParameter>
<engineParameter>
<name>PDS_WS_LOCATION</name>
<value>http://localhost:8080/pds-jbrain-ws/pdsservice?wsdl</value>
</engineParameter>
</engineConfiguration>
I'm trying to update the POS_PRINTER_PORT_ID
value, but I'm having a hard time getting it right.
I've tried the below commands:
xmlstarlet ed -u '/engineConfiguration/engineParameter/POS_PRINTER_PORT_ID' -v 9999 engineConfiguration.xml
xmlstarlet ed -N s=http://bla.com/engine/management/engineConfiguration -u '/s:engineConfiguration/s:engineParameter[name = "POS_PRINTER_PORT_ID"]/value' -v 999 engineConfiguration.xml
I was also trying with xmllint
but read that xmlstarlet
is the way to go.