Main > Programming > Libraries >

XML::Rules 0.18

XML::Rules 0.18

Sponsored Links

XML::Rules 0.18 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
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);

XML::Rules 0.18 Screenshot

Advertisements

XML::Rules 0.18 Keywords

Bookmark XML::Rules 0.18

Hyperlink code:
Link for forum:

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

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
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