NAME
XML::XSS::Document - XML::XSS document stylesheet rule
VERSION
version 0.3.5
SYNOPSIS
use XML::XSS;
my $xss = XML::XSS->new;
my $doc_style = $xss->document;
$doc_style->set_pre( "=pod\n" );
$doc_style->set_post( "=cut\n" );
print $xss->render( '<doc>yadah yadah</doc>' );
DESCRIPTION
A XML::XSS
rule that matches against the document to be rendered.
Note that this is the XML::LibXML::Document
object, and not the document root element.
ATTRIBUTES
use_clean_stash
If set to true, which is the default, the stash cleared before a new document is rendered.
use_clean_stash()
Accessor getter.
set_use_clean_stash($bool)
Accessor setter.
RENDERING ATTRIBUTES
For a document, the displayed attributes follow the template:
pre
[document nodes]
post
pre
Printed before the document's nodes.
post
Printed after the document nodes.
content
If defined, will be used instead of the child nodes of the document.
METHODS
set( %attrs )
A shortcut to the attribute setters.
$doc_style->set(
pre => 'foo',
post => 'bar',
);
# equivalent to
$doc_style->set_pre( 'foo' );
$doc_style->set_post( 'bar' );
apply( $node, $args )
Applies the rule to the $node
, passing along the optional $args
, and returns the resulting string.
AUTHOR
Yanick Champoux <yanick@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017, 2013, 2011, 2010 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.