NAME

XML::XSS::Document - XML::XSS document stylesheet rule

VERSION

version 0.1_0

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.

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.