XML::XSS::Document - XML::XSS document stylesheet rule
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>' );
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.
If set to true, which is the default, the stash cleared before a new document is rendered.
For a document, the displayed attributes follow the template:
pre [document nodes] post
Printed before the document's nodes.
Printed after the document nodes.
If defined, will be used instead of the child nodes of the document.
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' );
Applies the rule to the
$node, passing along the optional
$args, and returns the resulting string.
Yanick Champoux <firstname.lastname@example.org>
This software is copyright (c) 2011 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.