Name : perl-XML-Filter-Digest
| |
Version : 0.06
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.6.1
| Date : 2023-01-27 16:49:36
|
Group : Development/Libraries/Perl
| Source RPM : perl-XML-Filter-Digest-0.06-lp154.6.1.src.rpm
|
Size : 0.14 MB
| |
Packager : https://www_suse_com/
| |
Summary : XML::Filter::Digest Perl module
|
Description :
Most XML tools aim to parse some simple XML and to produce some formatted output. *XML::Filter::Digest* aims to do the opposite.
Many formats can now be parsed by a SAX Driver. XPath offers a smart way to write queries to XML. XML::Filter::Digest is a PerlSAX Filter to query XML and to provide a simpler digest as a result.
XML::Filter::Digest uses its own script language that can be parsed by *XML::Script::Digest* to formulate these digest queries.
In fact, a digest script is well-formed XML.
The following script defines that the result XML should have a root element called _extract_, containing several elements called _section_ starting from the 4th HTML header. Those section elements contain _id_, _title_ and _intro_ elements, which in turn contain the XPath _string-value_ of their nodes as character data.
< digest name=\"extract\"> < collect name=\"section\" node=\"//html//h2[position()>3]\" > < collect name=\"id\" node=\"child::a/attribute::name\" /> < collect name=\"title\" node=\".\" /> < collect name=\"intro\" node=\"following-sibling::p[position()=1]\" /> < /collect> < /digest>
The digest script parser silently ignores anything other than _digest_ elements and _collect_ elements. The _digest_ element needs a _name_ attribute defining the name of the root element, while the _collect_ element needs an additional _node_ attribute defining XPath queries for nested elements.
Only a single digest element should exist within a script document, but there is no need that the digest script be the root element of the document. Nested within the digest element should be collect elements. They may contain several other collect elements recursivly.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-X/15.4/noarch |