I would like to know how can I split my data from the following format:
<datas>
<data>
<name>Name1</name>
</data>
<data>
<name>Name2</name>
</data>
</datas>
to the following format.
<data><name>Name1</name></data>
<data><name>Name2</name></data>
The parsed data would be sent to a Python script as followed:
python script.py <data><name>Name1<name></data>
python script.py <data><name>Name2<name></data>
I have tried commands like
echo 'cat /datas/data' | xmllint --shell file.xml
but I do not know how to store in a variable and use for loop to sent it to the python script
or other means to achieve the same results
Although I have other ideas or workaround, for instance using Python script to parse and execute the robot, but I hope to see if there is such possibility to use .sh file to do it. :)