From 86dad5c7f117dc05c730a1184a53b0ce38e62ed9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 27 Aug 2011 17:53:03 +0100 Subject: [PATCH] inspector: Use xmlstarlet instead of xpath in examples. (cherry picked from commit baefb8225c8cbde56a1637c17af5c0965a81060e) --- inspector/virt-inspector.pod | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/inspector/virt-inspector.pod b/inspector/virt-inspector.pod index 5496827..df9dfda 100755 --- a/inspector/virt-inspector.pod +++ b/inspector/virt-inspector.pod @@ -329,22 +329,25 @@ installer, or one part of a multipart CD. For example: =head1 USING XPATH -You can use the XPath query language, and/or the xpath tool, in order -to select parts of the XML. +You can use the XPath query language to select parts of the XML. We +recommend using C to perform XPath queries from the +command line. For example: - $ virt-inspector -d Guest | xpath //filesystems - Found 1 nodes: - -- NODE -- + $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems' ext4 - [etc] + [...] $ virt-inspector -d Guest | \ - xpath "string(//filesystem[@dev='/dev/sda1']/type)" - Query didn't return a nodeset. Value: ext4 + xmlstarlet sel -t -c "string(//filesystem[@dev='/dev/sda1']/type)" + ext4 + + $ virt-inspector -d Guest | \ + xmlstarlet sel -t -v '//icon' | base64 -i -d | display - + [displays the guest icon, if there is one] =head1 SHELL QUOTING @@ -380,6 +383,7 @@ L, L, L, L, +L, L. =head1 AUTHORS -- 1.8.3.1