XML::Filter::Mode

XML::Filter::Mode Perl module can filter out all chunks not in the current mode.
Download

XML::Filter::Mode Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Barrie Slaymaker
  • Publisher web site:
  • http://search.cpan.org/~rbs/

XML::Filter::Mode Tags


XML::Filter::Mode Description

XML::Filter::Mode Perl module can filter out all chunks not in the current mode. XML::Filter::Mode Perl module can filter out all chunks not in the current mode.SYNOPSIS use XML::Filter::Mode; use strict; my $filter = XML::Filter::Mode->new( Modes => "a,b,c" ); my $filter = XML::Filter::Mode->new( Modes => ); ## To inspect the modes: my @modes = $filter->modes; ## To change the modes: $h->modes( qw( d e ) );Filters portions of documents based on a mode= attribute.I use this to have XML documents that can be read in several modes, for instance "test", "demo" and normal (ie not test or demo), or "C", "Bytecraft_C", "Perl".Mode names must contain only alphanumerics and "_" (ie match Perl's w regexp assertion).The filter is given a comma separated list of modes. Each element in the XML document may have a mode="" attribute that gives a mode expression. If there is no mode attribute or it is empty or the mode expression matches the list of modes, then the element is accepted. Otherwise it and all of its children are cut from the document.The mode expression is a boolean expression using the operators & (which unfortunately must be escaped as "&"), |, , to build mode matching expressions from a list Parentheses may be used to group operations. of words. , and are synonyms.! may be used as a prefix negation operator, so !a means "unless mode a".Examples: Modes mode="..." Action Enabled Value ===== ========== ====== (none) "" pass a "" pass a "a" pass a "a" pass a,b "a" pass a "a,b" pass b "a,b" pass a,b "a,b" pass b "!a,b" pass a,b "a b" pass (none) "b" cut a "b" cut a "a&b" cut b "a&b" cut a "!a,b" cut a "!a" cut Requirements: · Perl


XML::Filter::Mode Related Software