The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache::AxKit::Language::YPathScript - An XML Stylesheet Language

SYNOPSIS

  AxAddStyleMap "application/x-xpathscript => \
        Apache::AxKit::Language::YPathScript"

DESCRIPTION

YPathScript is a fork of the original AxKit's XPathScript using XML::XPathScript as its transforming engine.

As it is mostly backward compatible with the classic Axkit XPathScript module, the definitive reference for XPathScript, located at http://axkit.org/docs/xpathscript/guide.dkb, also applies to YPathScript, excepts for the differences listed in the sections below.

PRE-DEFINED STYLESHEET VARIABLES AND FUNCTIONS

VARIABLES

$r

A copy of the Apache::AxKit::request object -- which is itself a wrapper around the Apache::request object -- tied to the current document.

        <%      %args = $r->args() %>
        <p>args: <%= join ' : ', map "$_ => $args{$_}", keys %args %></p>

FUNCTIONS

$node = XML::XPathScript::current->document( $uri )

Fetch the xml document located at $uri and return it as a dom node.

Functions

$xps = new Apache::AxKit::Language::YPathScript($xml_provider, $style_provider)

Construct a new YPathScript language interpreter out of the provided providers.

$rc = handler( $class, $request, $xml_provider, $style_provider )
        The handler function called by Apache. 
$file_content = include_file( $filename )
$file_content = include_file( $filename, @includestack )

Overloaded from XML::XPathScript in order to provide URI-based stylesheet inclusions: $filename may now be any AxKit URI. The AxKit language class drops support for plain filenames that exists in the ancestor class: this means that include directives like

   <!-- #include file="/some/where.xps" -->

in existing stylesheets should be turned into

   <!-- #include file="file:///some/where.xps" -->

in order to work with AxKit.

$doc = get_source_tree( $xml_provider )

Read an XML document from the provider and return it as a string.

$string = read_stylesheet( $stylesheet )

Retrieve and return the $stylesheet (which can be a filehandler or a string) as a string.

$self->debug( $level, $message )

Print $message if the requested debug level is equal or smaller than $level.

$self->die( $suicide_note )

Print the $suicide_note and exit;

$nodeset = $self->document( $uri )

Read XML document located at $uri, parse it and return it in a node object.

The $uri can be specified using the regular schemes ('http://foo.org/bar.xml', 'ftp://foo.org/bar.xml'), or the Axkit scheme ('axkit://baz.xml'), or as a local file ('/home/web/foo.xml', './foo.xml' ).

BUGS

Please send bug reports to <bug-xml-xpathscript@rt.cpan.org>, or via the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=XML-XPathScript .

AUTHOR

Yanick Champoux <yanick@cpan.org>

Original Axkit::Apache::AxKit::Language module by Matt Sergeant <matt@sergeant.org>