John Beppu > Embedix-ECD > Embedix::ECD::XMLv1

Download:
Embedix-ECD-0.09.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Embedix::ECD::XMLv1 - adds a method to write ECD data as XML

SYNOPSIS ^

Load appropriate modules first

    use Embedix::ECD;
    use Embedix::ECD::XMLv1 qw(xml_from_cons);

load an ECD and print it as XML

    my $ecd->newFromFile('tinylogin.ecd');
    print $ecd->toXML;

If you want to preserve comments, use a cons instead of an Embedix::ECD object.

    my $cons = Embedix::ECD->consFromFile('tinylogin.ecd');
    print xml_from_cons($cons);

REQUIRES ^

Embedix::ECD

This is the module Embedix::ECD::XMLv1 augments.

EXPORTS ^

xml_from_cons($cons)

DESCRIPTION ^

This module adds a few methods to the Embedix::ECD namespace for the purposes of XML generation. The reason it has been separated from the main module is to allow one to only load this module when necessary and to save memory when you it's not.

METHODS ^

Generating XML from a cons

$xml = xml_from_cons($cons);

A cons (or nested arrayref) is generated from the constructors in Embedix::ECD that have names starting with "cons". This method will take a cons and generate well-formed XML from it. Because a cons preserves comments in an ECD, xml_from_cons() is able to preserve comments in the XML it generates.

Although the XML this generates will be well-formed, it runs a high risk of not being valid, because it cannot (yet?) order the attributes in accordance w/ the current DTD.

Add-ons to Embedix::ECD

$ecd = Embedix::ECD->newFromXML()

not implemented.

$xml = $ecd->toXML()

This generates an XML expression of an ECD in accordance to the DTD found in $Embedix::ECD::XMLv1::__dtd. The generated XML will be well-formed and valid.

$string = $ecd->attributeToXML()

This does the same thing as attributeToString() but generates XML, instead.

CLASS VARIABLES ^

$Embedix::ECD::XMLv1::__dtd

This contains the Document Type Definition for the XML version of the ECD format.

AUTHOR ^

John BEPPU <beppu@lineo.com>

SEE ALSO ^

related perl modules

Embedix::ECD(3pm)

syntax highlighting: