Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yanick/xml-xpathscript
a Perl framework for XML stylesheets
https://github.com/yanick/xml-xpathscript
perl stylesheet template xml
Last synced: 2 months ago
JSON representation
a Perl framework for XML stylesheets
- Host: GitHub
- URL: https://github.com/yanick/xml-xpathscript
- Owner: yanick
- Created: 2008-08-20T01:41:20.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2019-07-04T14:09:19.000Z (over 5 years ago)
- Last Synced: 2024-06-18T23:14:51.676Z (6 months ago)
- Topics: perl, stylesheet, template, xml
- Language: Perl
- Homepage:
- Size: 699 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README
- Changelog: Changes
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
XPathScript
================ DESCRIPTION
This is the XML::XPathScript stylesheet framework, part of the AxKit
project at http://axkit.org/.XPathScript is a stylesheet language similar in many ways to XSLT (in
concept, not in appearance), for transforming XML from one format to
another - possibly HTML, but XPathScript also shines for non-XML-like
output.Like XSLT, XPathScript offers a dialect to mix verbatim portions of
documents and code. Also like XSLT, it leverages the powerful
``templates/apply-templates'' and ``cascading stylesheets'' design
patterns, that greatly simplify the design of stylesheets for
programmers. The availability of the XPath query language inside
stylesheets promotes the use of a purely document-dependent,
side-effect-free coding style. But unlike XSLT which uses its own
dedicated control language with an XML-compliant syntax, XPathScript
uses Perl which is terse and highly extendable.The result of the merge is an extremely powerful tool for rendering
complex XML documents into other formats. Stylesheets written in
XPathScript are very easy to create, extend and reuse, even if they
manage hundreds of different XML tags. As a testimony to these
qualities, XML::XPathScript comes bundled with a fairly comprehensive
stylesheet for converting Docbook XML into LaTeX (in the examples/
directory).===== INSTALLATION
To install this module type the following:
perl ./Build.PL
./Build
./Build test
./Build installor, if you are old-school,
perl Makefile.PL
make
make test
make install
During installation, Build.PL will check if it should use XML::LibXML
or XML::XPath as the default xml parser. If you want to force XPathScript
to use one or the other, doperl Build.PL -parser=XML::LibXML
or
perl Build.PL -parser=XML::XPathIf AxKit or TomKit are present, their respective XPathScript processors will
be automatically added to the installation. To force their installation
without the presence of AxKit/TomKit, doperl Build.PL -axkit -tomkit
===== COMMAND-LINE USEThis module provides an xpathscript(1) shell command that comes with
its own manpage.===== SUPPORT FOR AXKIT
XPS comes with its AxKit language module. Not to clash with the
Apache::AxKit::Language::XPathScript.pm bundled with AxKit, it is named
Apache::AxKit::Language::YPathScript.pm. To use this module under AxKit,
add the following to your httpd.conf (the first two lines are probably
already present):PerlModule AxKit
AddHandler AxKit .xml
AxAddStyleMap application/x-ypathscript Apache::AxKit::Language::YPathScriptAnd to your .htaccess something like:
AxAddProcessor application/x-ypathscript your_stylesheet.xps
===== SUPPORT FOR TOMKIT
XPS also includes a TomKit processor, which will be installed if TomKit itself is
detected. To use the processor, add something like the following to your .htaccess:PerlSetVar AxAddProcessorMap "text/xps=>Apache2::TomKit::Processor::XPathScript"
PerlFixupHandler Apache2::TomKit
PerlSetVar AxAddProcessorDef "text/xps=>stylesheet.xps"