У меня есть следующий файл XML:
Я пытаюсь добавить следующее
<functions loglevel="error">
<function spreadsheet_function="GETTPOS"/>
<function spreadsheet_function="GETLPOS"/>
</functions>
Я выполнил следующее:
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
он создает следующее:
<function spreadsheet_function="GETTPOS" spreadsheet_function="GETLPOS"/>
<function spreadsheet_function="GETLPOS"/>
как я могу различать оба параметра xmlstarlet?