in reply to How do I ignore comments in an xml file when using win32::ole?
use warnings; use strict; use XML::Twig; my $str = <<EOF; <?xml version="1.0" encoding="UTF-8"?> <Header> <Main id="1" name="Item1"> </Main> <Main id="2" name="Item2"> </Main> <!--Main id="3" name="Item4"> </Main--> <Main id="4" name="Item5"> </Main> </Header> EOF my $t = XML::Twig->new(twig_handlers => { Main => sub {print $_->att('id'), "\n"} }); $t->parse($str); __END__ 1 2 4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I ignore comments in an xml file when using win32::ole?
by ketanh (Novice) on Jun 25, 2011 at 19:37 UTC | |
by toolic (Bishop) on Jun 25, 2011 at 19:45 UTC |