Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.330.753 Times

XML::Rules 0.18

  Date Added: May 09, 2010  |  Visits: 1.022

XML::Rules

Report Broken Link
Printer Friendly Version


Product Homepage
Download (99 downloads)



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);.

Requirements: No special requirements
Platforms: Linux
Keyword: Address Content Libraries Parse Xml Perl Module Print Process Tags Programming Rules Type Xmlrules
Users rating: 0/10

License: Freeware Size: 38.91 KB
USER REVIEWS
More Reviews or Write Review


XML::RULES RELATED
Science  -  Bio::Parse::SwissProt - perl module 0.5
A Perl module that provides methods for retrieving each and every field from a standard SwissProt file.
9.61 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  Any::Renderer::XML 1.014
Any::Renderer::XML Perl module can render a data structure as element-only XML. SYNOPSIS use Any::Renderer; my %xml_options = (); my %options = ( XmlOptions => %xml_options ); my $format = "XML"; my $r = new Any::Renderer ( $format,...
23.55 KB  
Libraries  -  Data::Phrasebook::Loader::XML 0.12
Data::Phrasebook::Loader::XML Perl module can abstract your phrases with XML. SYNOPSIS use Data::Phrasebook; my $q = Data::Phrasebook->new( class => Fnerk, loader => XML, file => phrases.xml, dict => Dictionary, # optional ); OR my...
17.41 KB  
Libraries  -  Gtk2::Ex::MindMapView::Content::Uri 0.000001
Gtk2::Ex::MindMapView::Content::Uri is a Perl module to display an clickable Uri. HEIRARCHY Gtk2::Ex::MindMapView::Content +----Gtk2::Ex::MindMapView::Content::EllipsisText +----Gtk2::Ex::MindMapView::Content::Uri SYNOPSIS use...
50.18 KB  
Libraries  -  Gtk2::Ex::MindMapView::Content::Picture 0.000001
Gtk2::Ex::MindMapView::Content::Picture is a Perl module to display a picture. HEIRARCHY Gtk2::Ex::MindMapView::Content +----Gtk2::Ex::MindMapView::Content::Picture SYNOPSIS use Gtk2::Ex::MindMapView::Content::Picture Displays a picture...
50.18 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Libraries  -  PIX::Walker 1.03
PIX::Walker is a Perl module to process Cisco PIX configs and walk access-lists. SYNOPSIS PIX::Walker is an object that allows you to process PIX firewall configs and walk an access-list for matches. PIX OS versions 6 and 7 are supported. **...
13.31 KB  
Libraries  -  Template::Ast 0.02
Template::Ast is a Perl module to process ASTs for Perl Template Toolkit. SYNOPSIS use Template::Ast; # Rebuild AST stored in file: $ast = Template::Ast->read(foo.ast) or die Template::Ast->error(); # Writing existing AST to file: $ast...
20.48 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB