Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: XML Newbie

by runrig (Abbot)
on Nov 16, 2012 at 16:15 UTC ( #1004216=note: print w/replies, xml ) Need Help??

in reply to XML Newbie

Here's an example w/XML::Rules. Note that getting at the underlying expat parser is undocumented, but I'm sure Jenda would be willing to add something as part of the official API :-)
use strict; use warnings; use XML::Rules; my @rules = ( gibsonca => undef, _default => sub { no warnings 'uninitialized'; return if $_[1]->{_content} =~ /\S/; my $p = $_[4]{parser}; print $p->current_line(),"\n"; return; }, ); my $xr = XML::Rules->new(rules => \@rules); $xr->parse(<<XML); <gibsonca> <abc>fds </abc> <!-- ok --> <ddd></ddd> <!-- not ok --> <eee> </eee> <!-- not ok --> </gibsonca> XML

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004216]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2016-10-23 10:37 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.