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

XML::XPathToXML 2.1.0

  Date Added: June 22, 2010  |  Visits: 812

XML::XPathToXML

Report Broken Link
Printer Friendly Version


Product Homepage
Download (89 downloads)



XML::XPathToXML is a Perl module that generates XML document from XPath expressions. SYNOPSIS my @data = ( /project/name => The Ultimate Question, /project/comment() => generated by XPathToXML , /project/start => 2002-09-08, /project/end => 7002002-09-08, /project/@id => 42, /project/temp/pre => 41, /project/temp/pre[position()=6] => 46, /project/temp/pre[3] => 43, /project/temp/pre[2] => XML::LibXML->new->parse_xml_chunk(q(arbitrary < b>XML< /b> chunk)), ); my $xpx = new XML::XPathToXML( debug=>1 ); $xpx->parse( @data ); $xpx->parse( /project/temp/pre[last()]/@guess, tooHigh ); print $xpx->documentElement->toString(1)."n"; Result: < project id="42"> < !-- generated by XPathToXML --> < name>The Ultimate Question< /name> < start>2002-09-08< /start> < end>7002002-09-08< /end> < temp> < pre>41< /pre> < pre>arbitrary < b>XML< /b> chunk< /pre> < pre>43< /pre> < pre/> < pre/> < pre guess="tooHigh">46< /pre> < /temp> < /project> Generates an XML document or node tree from one or more XPath expressions. Returnes an XML::LibXML::Document or XML::LibXML::Element. Only a limited subset of XPath is currently supported. Namely, the XPath expression must be a location path consisting of a /-separated sequence of one or more location steps along the child, sibling, or attribute axes. The node-test part of the expression cannot be neither a wildcard (*, @*, prefix:*, ...), nor the node() function. If a namespace prefix is used, then either the namespace must already be declared in the document or registered with an XPathContext object. Location steps may contain arbitrary predicates (filters), but see the details below. The parser processes the location path as follows: For an absolute location path (starting with /) the evaluation starts on the document node. For relative location path the evaluation starts on a specified initial context node. The parser evaluates the location path from left to right, one location step at a time, starting either on the document node (in case of absolute location path) or on a specified initial context node (in case of relative location paths). If the location step (including filters) matches a child node or an attribute of the current node, then the parser moves to the first node matched and to the next location step. If no nodes are matched by the location step, then the parser creates an element or attribute with the name (and possibly namespace) specified in the node-test part of the location step and tries again. If still no nodes are matched, the parser repeats the procedure until the location step matches or the number of sibling nodes created in this way reaches the limit specified in maximumAutoSiblings. In the first case the parser moves to the first matching node. In the latter case the parser fails (removing all sibling-nodes created for the failed location-step from the tree). Hence, if a filter predicate of a location step specifies a position of a node (e.g. with [4], or [position3], etc), then the parser tries to automatically create empty siblings nodes until it finally creates one with for which the predicate is true. Note, that because the parser only processes one location step at a time and always picks the first matching node, expressions like /root/a/b are treated as /root/a[1]/b[1]. So, in case of the document < root> < a/> < a> < b/> < /a> < /root> $xpx->parse(q(/root/a/b),foo) will result in < root> < a>< b>foo< /b>< /a> < a> < b/> < /a> < /root> although an element matching /root/a/b was already present in the document. To prevent this, either explicitly state that b must exist with /root/a[b]/b or set the second element a as the context node and use a relative location path such as b: $xpx->setContextNode($xpc->document->find(/root/a[2])->get_node(1)) $xpx->parse("b","foo"); # "./b" is also ok or simply $xpx->createNode("b","foo",$xpc->document->find(/root/a[2])->get_node(1)); In the tradition of XML::LibXML errors must be trapped with eval() (the parser dies on error)..

Requirements: No special requirements
Platforms: Linux
Keyword: Document In Case Of Libraries Libxml Location Location Path Node Parser Path Perl Module Xml Document Xmlxpathtoxml Xpathtoxml
Users rating: 0/10

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


XML::XPATHTOXML RELATED
Libraries  -  Smieciuch++ 0.6.4 RC3
Smieciuch library is a precise (in case of C++) or nearly precise (in case of plain C) tracing garbage collector. Tracing means that GC scans memory for active pointers and traces all paths (consisting of possibly multiple pointer indirections)...
 
Libraries  -  Bio::NEXUS::Node 0.67
Bio::NEXUS::Node is a Perl module that provides functions for manipulating nodes in trees. SYNOPSIS new Bio::NEXUS::Node; METHODS new Title : new Usage : $node = new Bio::NEXUS::Node(); Function: Creates a new Bio::NEXUS::Node object...
153.6 KB  
Security Tools  -  MobileTracker Pro 1.0
This is an essential piece of software that any smartphone users must have. Smartphones are used widely for storing contacts, email passwords, credit card numbers and other sensitive information. Losing one can be a major privacy and security...
101.03 KB  
Libraries  -  Math::Matrix 0.5
Math::Matrix can multiply and invert Matrices. The following methods are available: new Constructor arguments are a list of references to arrays of the same length. The arrays are copied. The method returns undef in case of error. $a = new...
6.14 KB  
Desktop Utilities  -  1 Click & Go 1.2993
1 Click & Go works as a Windows toolbar designed for easy access, open and execute files and folders that you often use. Program similar well-known Microsoft Office Panel, but not lose configuration in case of a system crash. It supports the...
302.75 KB  
Utilities  -  Reboot Service 1.0
KutinSoft Reboot Service is a freeware service designed to reboot a computer remotely or in case of memory overflow. General service characteristics: - All aspects of service work can be configurated; - It is able to follow quantity of free...
1.21 MB  
Personal Information Managers  -  ProfileMD Classic 1.02
ProfileMD Classic is a FREEWARE personal health record that can give you instant access to your medical history in case of emergencies, physician office visits, or anytime you need the details of your medical history around-the-clock, anywhere in...
620 KB  
Server Tools  -  SyncServer 4.5+
SyncServer - Maintain a copy of files on another server, handy for load-sharing servers, or to have a secondary server standing by to take over in case of a crash. This utility makes an exact replica of files on a machine via the network to...
69 KB  
Libraries  -  Stream::Reader 0.09
Stream::Reader is a stream reader Perl class. SYNOPSIS # Input stream can be reference to TYPEGLOB or SCALAR, output stream # can be the same types or undefined # Constructor $stream = Stream::Reader->new( *IN, { Limit => $limit, BuffSize...
6.14 KB  
Libraries  -  Statistics::Descriptive 2.6
Statistics::Descriptive is a Perl module of basic descriptive statistical functions. SYNOPSIS use Statistics::Descriptive; $stat = Statistics::Descriptive::Full->new(); $stat->add_data(1,2,3,4); $mean = $stat->mean(); $var =...
11.26 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