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.545.020 Times

XML::Filter::DOMFilter::LibXML 0.02

  Date Added: July 19, 2010  |  Visits: 502

XML::Filter::DOMFilter::LibXML

Report Broken Link
Printer Friendly Version


Product Homepage
Download (72 downloads)



XML::Filter::DOMFilter::LibXML is a SAX Filter allowing DOM processing of selected subtrees. SYNOPSIS use XML::LibXML; use XML::Filter::DOMFilter::LibXML; my $filter = XML::Filter::DOMFilter::LibXML->new( Handler => $handler, XPathContext => XML::LibXML::XPathContext->new(), Process => [ /foo[@A=aaa]/*/bar => &process_bar, baz[parent::*/@B=bbb] => &process_baz ] ); my $parser = XML::SAX::YourFavoriteDriver->new( Handler => $filter ); # Some DOM processing sub process_bar { my ($node)=@_; my $doc=$node->ownerDocument; $node->appendTextChild("note","hallo world!"); $node->parentNode->insertAfter($doc->createElement("foo"),$node); } sub process_baz { my ($node)=@_; $node->unbindNode; } This module provides a compromise between SAX and DOM processing by allowing to use DOM API to process only reasonably small parts of an XML document. It works as a SAX filter temporarily building small DOM trees around parts selected by given XPath expressions (with some limitations, see "LIMITATIONS"). The filter has two states which will be refered to as A and B here. The initial state of the filter is A. In the state A, only a limited vertical portion of the DOM tree is built. All SAX events other than start_element are immediatelly passed to Handler. On start_element event, a new element node is created in the DOM tree. All possible existing siblings of the newly created node are removed. Thus, while in state A, there is exactly one node on every level of the tree. Now all the XPath expressions are checked in the context of the newly created node. If none of the expressions matches, the parser remains in state A and passes the start_element event to Handler. Otherwise, the callback associated with the first expression that matched is remembered and the parser changes its state to B. In state B the filter builds a complete DOM subtree of the new element according to the incomming events. No events are passed to Handler at this stage. When the subtree is complete (i.e. the corresponding end-tag is encountered), the callback associated with the XPath expression that matched is executed. The root element of the subtree is passed to the callback subroutine as the only argument. The callback is allowed to do any DOM operations on the DOM subtree, even to replace it with one or more new subtrees. The callack must, however, preserve the elements parent node as well as all its ancestor nodes intact. Failing to do so can result in an error or unpredictable results. When the callback returns, all subtrees that now appear in the DOM tree under the original element parent are serialized to SAX events and passed to Handler. After that, they are deleted from the DOM tree and the filter returns to state A. Limitations:.

Requirements: No special requirements
Platforms: Linux
Keyword: Dom Domfilter Element Filter Libraries Libxml Node Processing Programming Sax Sax Filter Xml Xmlfilterdomfilterlibxml Xpath
Users rating: 0/10

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


XML::FILTER::DOMFILTER::LIBXML RELATED
Libraries  -  XML::LibXML::Node 1.61003
XML::LibXML::Node is an abstract base class of XML::LibXML nodes. SYNOPSIS $name = $node->nodeName; $node->setNodeName( $newName ); $bool = $node->isSameNode( $other_node ); $bool = $node->isEqual( $other_node ); $content =...
256 KB  
Libraries  -  XML::Filter::DocSplitter 0.41
XML::Filter::DocSplitter does multipass processing of documents. SYNOPSIS ## See XML::SAX::???? for an easier way to use this filter. use XML::SAX::Machines qw( Machine ) ; my $m = Machine( [ Intake => "XML::Filter::DocSplitter" => qw(...
43.01 KB  
Libraries  -  GLGraphics 20110116 Unstab
GLGraphics is a handy library specially designed for the processing programming language that integrates OpenGL textures and GPU-accelerated effects into the Processing API. This library offers two main classes, GLTexture and GLTextureFilter, and...
 
Libraries  -  XML::DOM::Text 1.44
XML::DOM::Text is a piece of XML text in XML::DOM. XML::DOM::Text extends XML::DOM::CharacterData, which extends XML::DOM::Node. The Text interface represents the textual content (termed character data in XML) of an Element or Attr. If there...
112.64 KB  
Libraries  -  XML::DOM::Attr 1.44
XML::DOM::Attr is an XML attribute in XML::DOM. XML::DOM::Attr extends XML::DOM::Node. The Attr nodes built by the XML::DOM::Parser always have one child node which is a Text node containing the expanded string value (i.e. EntityReferences are...
112.64 KB  
Libraries  -  XML::Filter::DataIndenter 0.1
XML::Filter::DataIndenter is a SAX2 Indenter for data oriented XML. SYNOPSIS use XML::Filter::DataIndenter; use XML::SAX::Machines qw( Pipeline ); Pipeline( XML::Filter::DataIndenter => *STDOUT ); ALPHA CODE ALERT: This is the first...
3.07 KB  
Libraries  -  XML::DOM::DocumentType 1.44
XML::DOM::DocumentType is an XML document type (DTD) in XML::DOM. XML::DOM::DocumentType extends XML::DOM::Node. Each Document has a doctype attribute whose value is either null or a DocumentType object. The DocumentType interface in the DOM...
112.64 KB  
Libraries  -  XML::Filter::Sort::Buffer 1.01
XML::Filter::Sort::Buffer is an implementation class used by XML::Filter::Sort. The documentation is targetted at developers wishing to extend or replace this class. For user documentation, see XML::Filter::Sort. For an overview of the classes...
25.6 KB  
Libraries  -  XML::DOM::XMLDecl 1.44
XML::DOM::XMLDecl is a XML declaration in XML::DOM. XML::DOM::XMLDecl extends XML::DOM::Node, but is not part of the DOM Level 1 specification. It contains the XML declaration, e.g. ...
112.64 KB  
Libraries  -  Plagger::Plugin::Filter::Emoticon 0.7.17
Plagger::Plugin::Filter::Emoticon is a Perl module with emoticon filter. SYNOPSIS - module: Filter::Emoticon config: driver: Yahoo option: strict: 1 xhtml: 0 This filter replaces text emoticons like ":-)", ";-P" etc. with...
317.44 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  -  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  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB