Yanick Champoux > XML-XSS-0.3.4 > XML::XSS::Text

Download:
XML-XSS-0.3.4.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: v0.3.4   Source  

NAME ^

XML::XSS::Text - XML::XSS text stylesheet rule

VERSION ^

version 0.3.4

SYNOPSIS ^

    use XML::XSS;

    my $xss = XML::XSS->new;

    my $txt_style = $xss->text;

    $txt_style->set_pre( "=pod\n" );
    $txt_style->set_post( "=cut\n" );

    print $xss->render( '<doc>yadah yadah</doc>' );

DESCRIPTION ^

A XML::XSS rule that matches against the text nodes of a document to be rendered.

RENDERING ATTRIBUTES ^

For a document, the displayed attributes follow the template:

    pre
    [text]
    post

pre

Printed before the text.

getter - pre()

setter - set_pre( $pre )

replace

If defined, its value is used instead of the original text.

filter

Can only accept a sub reference. If defined, the text will be passed to the function as $_ and the returned value will be printed out. Still is applied even if replace is used.

    $xss->set( '#text', {
        filter => sub { uc },
    } );

post

Printed after the text.

getter - post()

setter - set_post( $post )

process

If it resolves to false, skip the element altogether.

get_process()

Attribute getter.

set_process( $process )

Attribute setter.

AUTHOR ^

Yanick Champoux <yanick@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 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.

syntax highlighting: