NAME

POE::XUL::CDATA - XUL CDATA

SYNOPSIS

use POE::XUL::Node;
use POE::XUL::CDATA;

my $cdata = POE::XUL::CDATA->new( $raw_data );
$node->appendChild( $cdata );

Script( <<JS );
    function something() {
        // JS code here
    }
JS

DESCRIPTION

POE::XUL::CDATA instances is are DOM-like object for holding and manipulating character data. CDATA differs from a TextNode in that & and < are ignored. This is especially useful for Javascript; CDATA in a Script node will be eval()ed by the client javascript library.

METHODS

While POE::XUL::CDATA offers the full DOM interface, the ChangeManager will transmit data at each update. This means that if you modify the data more then once during an event, the data will be sent multiple times in the response and eval()ed multiple times if it the child of a Script node. This may or may not be what you want.

nodeValue

$cdata->nodeValue( $raw_data );
$data = $cdata->nodeValue;

appendData

$cdata->appendData( $more_js );

deleteData

$cdata->deleteData( $offset, $count );

insertData

$cdata->insertData( $offset, $more_data );

replaceData

$cdata->insertData( $offset, $count, $more_data );

substringData

my $data = $cdata->substringData( $offset, $count );

as_xml

my $xml = $cdata->as_xml;

children

Returns an empty array.

dispose

Does nothing.

AUTHOR

Philip Gwyn <gwyn-at-cpan.org>

CREDITS

Based on XUL::Node by Ran Eilam.

COPYRIGHT AND LICENSE

Copyright 2007-2010 by Philip Gwyn. All rights reserved;

Copyright 2003-2004 Ran Eilam. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

perl(1), POE::XUL, POE::XUL::Node, , POE::XUL::TextNode.