GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XML::DECLARE (3)

.ds Aq ’

NAME

XML::Declare - Create XML documents with declaration style

CONTENTS

SYNOPSIS



        my $doc = doc {
                element feed => sub {
                        attr xmlns => http://www.w3.org/2005/Atom;
                        comment "generated using XML::Declare v$XML::Declare::VERSION";
                        for (1..3) {
                                element entry => sub {
                                        element title     => Title, type => text;
                                        element content   => sub {
                                                attr type => text;
                                                cdata Desc;
                                        };
                                        element published => 123123-1231-123-123;
                                        element author => sub {
                                                element name => Mons;
                                        }
                                };
                        }
                };
        } 1.0,utf-8;

        print $doc;

        doc { DEFINITIONS } < args to XML::LibXML::Document->new >

        Where DEFINITIONS are
       
        element name => sub { DEFINITIONS }
        or
        element
                name => TextContent,
                attr => value,
                attr1 => [qw(more values)];
       
        attr name => values;
       
        text $content;
       
        cdata $content;
       
        comment $content;



EXPORT

doc BLOCK [ CW$version, CW$charset ];

Create XML::LibXML::Document;

element CW$name, sub { ... };

Create XML::LibXML::Element with name $name; everything, called within sub { ... } will be appended as children to this element

element CW$name, ATTRS

Create XML::LibXML::Element with name $name and set it’s attributes. ATTRS is a pairs of key = value>

attr CW$name, CW$value

Create XML::LibXML::Attribute with name $name and value $value

text CW$content

Create XML::LibXML::Text node with content $content

cdata CW$content

Create XML::LibXML::CDATASection node with content $content

comment CW$content

Create XML::LibXML::Comment node with content $content

AUTHOR

Mons Anderson <mons@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2009-2010 Mons Anderson.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 XML::DECLARE (3) 2012-05-29

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.