XML::Rules 0.18
Sponsored Links
XML::Rules 0.18 Ranking & Summary
File size:
0.038 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
817
Date added:
2007-07-31
Publisher:
Jan Krynicky
XML::Rules 0.18 description
XML::Rules is a Perl module that can parse XML & process tags by rules starting from leaves.
SYNOPSIS
use XML::Rules;
$xml = < < *END*
< doc >
< person >
< fname >...< /fname >
< lname >...< /lname >
< email >...< /email >
< address >
< street >...< /street >
< city >...< /city >
< country >...< /country >
< bogus >...< /bogus >
< /address >
< phones >
< phone type="home" >123-456-7890< /phone >
< phone type="office" >663-486-7890< /phone >
< phone type="fax" >663-486-7000< /phone >
< /phones >
< /person >
< person >
< fname >...< /fname >
< lname >...< /lname >
< email >...< /email >
< address >
< street >...< /street >
< city >...< /city >
< country >...< /country >
< bogus >...< /bogus >
< /address >
< phones >
< phone type="office" >663-486-7891< /phone >
< /phones >
< /person >
< /doc >
*END*
@rules = (
_default = > sub {$_[0] = > $_[1]- >{_content}},
# by default Im only interested in the content of the tag, not the attributes
bogus = > undef,
# lets ignore this tag and all inner ones as well
address = > sub {address = > "$_[1]- >{street}, $_[1]- >{city} ($_[1]- >{country})"},
# merge the address into a single string
phone = > sub {$_[1]- >{type} = > $_[1]- >{content}},
# lets use the "type" attribute as the key and the content as the value
phones = > sub {delete $_[1]- >{_content}; %{$_[1]}},
# remove the text content and pass along the type = > content from the child nodes
person = > sub { # lets print the values, all the data is readily available in the attributes
print "$_[1]- >{lname}, $_[1]- >{fname} < $_[1]- >{email} >n";
print "Home phone: $_[1]- >{home}n" if $_[1]- >{home};
print "Office phone: $_[1]- >{office}n" if $_[1]- >{office};
print "Fax: $_[1]- >{fax}n" if $_[1]- >{fax};
print "$_[1]- >{address}nn";
return; # the < person > tag is processed, no need to remember what it contained
},
);
$parser = XML::Rules- >new(rules = > @rules);
$parser- >parse( $xml);
SYNOPSIS
use XML::Rules;
$xml = < < *END*
< doc >
< person >
< fname >...< /fname >
< lname >...< /lname >
< email >...< /email >
< address >
< street >...< /street >
< city >...< /city >
< country >...< /country >
< bogus >...< /bogus >
< /address >
< phones >
< phone type="home" >123-456-7890< /phone >
< phone type="office" >663-486-7890< /phone >
< phone type="fax" >663-486-7000< /phone >
< /phones >
< /person >
< person >
< fname >...< /fname >
< lname >...< /lname >
< email >...< /email >
< address >
< street >...< /street >
< city >...< /city >
< country >...< /country >
< bogus >...< /bogus >
< /address >
< phones >
< phone type="office" >663-486-7891< /phone >
< /phones >
< /person >
< /doc >
*END*
@rules = (
_default = > sub {$_[0] = > $_[1]- >{_content}},
# by default Im only interested in the content of the tag, not the attributes
bogus = > undef,
# lets ignore this tag and all inner ones as well
address = > sub {address = > "$_[1]- >{street}, $_[1]- >{city} ($_[1]- >{country})"},
# merge the address into a single string
phone = > sub {$_[1]- >{type} = > $_[1]- >{content}},
# lets use the "type" attribute as the key and the content as the value
phones = > sub {delete $_[1]- >{_content}; %{$_[1]}},
# remove the text content and pass along the type = > content from the child nodes
person = > sub { # lets print the values, all the data is readily available in the attributes
print "$_[1]- >{lname}, $_[1]- >{fname} < $_[1]- >{email} >n";
print "Home phone: $_[1]- >{home}n" if $_[1]- >{home};
print "Office phone: $_[1]- >{office}n" if $_[1]- >{office};
print "Fax: $_[1]- >{fax}n" if $_[1]- >{fax};
print "$_[1]- >{address}nn";
return; # the < person > tag is processed, no need to remember what it contained
},
);
$parser = XML::Rules- >new(rules = > @rules);
$parser- >parse( $xml);
XML::Rules 0.18 Screenshot
XML::Rules 0.18 Keywords
XML
Rules 0.18
starting from
process tags
Phone Type
Perl module
Parse XML
1
rules
type
content
print
address
XML::Rules
XMLRules
XML::Rules 0.18
Bookmark XML::Rules 0.18
XML::Rules 0.18 Copyright
WareSeeker periodically updates pricing and software information of XML::Rules 0.18 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of XML::Rules 0.18 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
contential airlines
rules of the road
javascript parse xml
work in process tags
perl modules
poker rules
caffeine content of drinks
content security software
rules of tennis
parse xml java
type url
rules of engagement
content management system
content paradise
rules of football
texas hold em rules
contents insurance
install perl module
Related Software
XML::Bare is a minimal XML parser implemented via a C state engine. Free Download
XML::DOM::Lite::XSLT is Perl module XSLT engine for XML::DOM::Lite. Free Download
XML::DocStats is a Perl module to produce a simple analysis of an XML document. Free Download
VTD-XML is a non-extractive XML processing software API implementing Virtual Token Descriptor. Free Download
XML::Output is a Perl module for writing simple XML documents. Free Download
Pod::XML is a Perl module to convert POD to XML. Free Download
XML::Compile::Schema::XmlReader Perl module contains bricks to translate XML to HASH. Free Download
XML::DOM::XML_Base Perl module can apply xml:base to attribute values. Free Download
Latest Software
Popular Software
Favourite Software