Keith Fahlgren
11/20/2006 11:51:00 PM
On 11/20/06, Jerome --- <jerome@tut0r.com> wrote:
> I am trying to parse some files that contain comments like this:
> ...
> I am not aware of a way to refer to commented HTML
> through CSS or XPath selectors.
The XPath comment() selector will select all comments:
For example (xpath after -m flag):
keith@devel ~ $ xml sel -t -m '//comment()' -v '.' -n simple.xml
one comment
two comment
keith@devel ~ $ cat simple.xml
<simple>
<!-- one comment -->
<foo/>
<!-- two comment -->
<bar/>
</simple>
HTH,
Keith