NAME
XML2 - Perl extension for generating Scalable Vector Graphics (SVG) documents
VERSION
Version 1.01, 01 May, 2006
DESCRIPTION
SVG is a 100% Perl module which generates a nested data structure containing the DOM representation of an SVG (Scalable Vector Graphics) image. Using SVG, you can generate SVG objects, embed other SVG instances into it, access the DOM object, create and access javascript, and generate SMIL animation content.
The original module SVG.pm was rewritten to provide OO APIs to the SVG elements, OO access to their Attributes and to seperate out the SVG document from the SVG element.
METHODS
new
$xml = XML2->new( -file = [xmlfilename], -data = [xmldata], %options );
Create a new xml object, it will parse a file or data if required or will await creation of nodes.
parseDocument
Parse existing xml data into a document.
xmlify (alias: to_xml render, serialize, serialise)
$string = $xml->xmlify(%attributes);
Returns xml representation of xml document.
extention
$extention = $xml->extention;
Does not work, legacy option maybe enabled in later versions.
options
namespace - Default document name space
name - Document localName
doctype - Document Type object
version - XML Version
encoding - XML Encoding
standalone - XML Standalone
INTERNAL METHODS
_serialise_doctype
$xml->_serialise_doctype( seperator => "\n" );
Returns the document type in an xml header form.
_serialise_extention
$xml->_serialise_extention( seperator => "\n" );
Returns the document extentions.
_serialise_header
$xml->_serialise_header( );
The XML header, with version, encoding and standalone options.
_element_handle
$xml->_element_handle( $type, %element-options );
Returns an XML element based on $type, use to extentd element capabilties.
_document_name
$xml->_document_name;
Returns the doctype name or 'xml' as default, can be extended.
_credit_comment
$xml->_credit_comment;
Returns the comment credit used in the output
AUTHOR
Martin Owens, doctormo@cpan.org
CREDITS
Based on SVG.pm by Ronan Oger, ronan@roasp.com
SEE ALSO
perl(1),XML2,XML2::Parser http://www.w3c.org/Graphics/SVG/ SVG at the W3C