Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

Comment on Re: XML Newbie
Download Code

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 meditating upon the Monastery: (3)
As of 2015-11-29 20:03 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (753 votes), past polls