0

I have the following XML file:

I try to add the following

<functions loglevel="error">
<function spreadsheet_function="GETTPOS"/>
<function spreadsheet_function="GETLPOS"/>
</functions>

I executed the following:

xmlstarlet ed -s "/_:php_macro_engine_config" -t elem -n "functions" -v "" -i "/_:php_macro_engine_config/functions" -t attr -n loglevel -v error
-s "/_:php_macro_engine_config/functions" -t elem -n "function" -i "/_:php_macro_engine_config/functions/function" -t attr -n spreadsheet_function -v GETTPOS
-s "/_:php_macro_engine_config/functions" -t elem -n "function" -i "/_:php_macro_engine_config/functions/function" -t attr -n spreadsheet_function -v GETLPOS 
macro_engine_config.xml

it creates the following:

<function spreadsheet_function="GETTPOS" spreadsheet_function="GETLPOS"/>
<function spreadsheet_function="GETLPOS"/>

how can I differentiate both in the xmlstarlet parameters?

laloune
  • 548
  • 1
  • 9
  • 26

0 Answers0