Comment 2 for bug 769622

Revision history for this message
Steve Newcomb (srn-coolheads) wrote :

I have also found a completely different bug in the xml output of a slightly more elaborate lshw invocation:

lshw -xml -class disk

The xml output of lshw is all <node> elements. When the lshw invocation is:

lshw -xml

that's fine, because the host machine's <node> is the container element for all the other <node>s. But when the output is restricted to '-class disk', only the disk <node>s appear, without any container element. In such a case, the xml parser (in my particular case, expat) sees the first <node> as the entire document, and all succeeding <node>s as unparseable "junk after document element".

So, when the output is restricted to a single class, there still needs to be some sort of container element. There are two obvious possible answers:

(1) Never exclude the host-machine node, so it's always the container element.

or

(2) Generate a bogus container element, such as <lshw> or <document> or something like that.