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

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

Serving Software Downloads in 976 Categories, Downloaded 29.649.712 Times

XML::Rules 0.18

  Date Added: May 09, 2010  |  Visits: 660

XML::Rules

Report Broken Link
Printer Friendly Version


Product Homepage
Download (70 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
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  -  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  
Libraries  -  Data::Stag 0.10
Data::Stag is a Perl module with structured tags datastructures. SYNOPSIS # PROCEDURAL USAGE use Data::Stag qw(:all); $doc = stag_parse($file); @persons = stag_find($doc, "person"); foreach $p (@persons) { printf "%s, %s phone: %sn",...
440.32 KB  
Libraries  -  MP3::Tag 0.9709
MP3::Tag is a Perl module for reading tags of MP3 audio files. SYNOPSIS use MP3::Tag; $mp3 = MP3::Tag->new($filename); # get some information about the file in the easiest way ($title, $track, $artist, $album, $comment, $year, $genre) =...
174.08 KB  
Libraries  -  Gtk2::Ex::MindMapView::HotSpot::Grip::Round 0.000001
Gtk2::Ex::MindMapView::HotSpot::Grip::Round is a Perl module to manage a round grip type "hot spot" on a view item. SYNOPSIS use Gtk2::Ex::MindMapView::HotSpot::Grip::Round; The Gtk2::Ex::MindMapView::HotSpot::Grip::Round is a round grip...
50.18 KB  
Libraries  -  Gtk2::Ex::MindMapView::HotSpot::Grip::EllipseRound 0.000001
Gtk2::Ex::MindMapView::HotSpot::Grip::EllipseRound is a Perl module to manage a round grip type "hot spot" on a ellipse item. This grip differs from the standard grip with respect to where it is placed on the Gtk2::Ex::MindMapView::Item....
50.18 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.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...
2.73 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