#1 Le 12/07/2015, à 22:21
- Arbiel
xmllint --xpath sur une machine VirtualBox semble ne pas fonctionner
Bonsoir à tous
Je trouve la réponse rendue par xmllint --path a priori plus facile à exploiter que la réponse rendue par les diverses commandes de VBoxManage, mais je ne parviens pas à obtenir les résultats escomptés.
Voici les tests que j'ai exécutés
echo $xpath
VirtualBox/Machine
remi@remi-Vostro-3550:~$ cat ~/Bureau/test.vbox
<?xml version="1.0"?>
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
<Machine uuid="{88a3192d-b200-4669-8013-ced1c91644dc}" name="Windows 7EF-32bits" OSType="Windows7" snapshotFolder="Snapshots" lastStateChange="2015-06-15T19:11:22Z">
</Machine>
</VirtualBox>
remi@remi-Vostro-3550:~$ cat ~/Bureau/test.vbox | xmllint --xpath "$xpath" -
XPath set is empty
remi@remi-Vostro-3550:~$ cat ~/Bureau/test.xml
<?xml version="1.0"?>
<VirtualBox toto="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
<Machine uuid="{88a3192d-b200-4669-8013-ced1c91644dc}" name="Windows 7EF-32bits" OSType="Windows7" snapshotFolder="Snapshots" lastStateChange="2015-06-15T19:11:22Z">
</Machine>
</VirtualBox>
remi@remi-Vostro-3550:~$ cat ~/Bureau/test.xml | xmllint --xpath "$xpath" -
<Machine uuid="{88a3192d-b200-4669-8013-ced1c91644dc}" name="Windows 7EF-32bits" OSType="Windows7" snapshotFolder="Snapshots" lastStateChange="2015-06-15T19:11:22Z">
</Machine>
S'agit-il d'une erreur de xmllint ?
Arbiel
Dernière modification par Arbiel (Le 12/07/2015, à 22:44)
Arbiel Perlacremaz
LDLC Aurore NK3S-8-S4 Ubuntu 20.04, GNOME 3.36.8
24.04 en cours de tests
Abandon d'azerty au profit de bépo, de google au profit de Lilo et de la messagerie électronique violable au profit de Protonmail, une messagerie chiffrée de poste de travail à poste de travail.
Hors ligne