NAME

XML::NewsML_G2::Writer - base class for XML DOM tree creation conforming to NewsML G2

SYNOPSIS

my $w = XML::NewsML_G2::Writer_2_12->new
    (news_item => $ni, scheme_manager => $sm);

my $p = $w->create_element('p', class => 'main', _text => 'blah');

my $dom = $w->create_dom();

DESCRIPTION

This module acts as a NewsML-G2 version-independent base class. Instead of using this class, use the most current subclass, e.g. XML::NewsML_G2::Writer_2_12.

ATTRIBUTES

news_item

XML::NewsML_G2::News_Item instance used to create the output document

encoding

Encoding used to create the output document, defaults to utf-8

generator

String used in output as the generator program name

scheme_manager

XML::NewsML_G2::Scheme_Manager instance used to create qcodes

doc

XML::LibXML::Document instance used to create the output document

g2_ns

XML Namespace of NewsML G2

xhtml_n2

XML Namespace of XHTML

g2_version

Specified by subclass.

schema_location

Specified by subclass.

g2_catalog_url

URL of the G2 catalog, specified by subclass.

g2_catalog_schemes

Reference to a hash of schemes that are covered by the G2 catalog. If the value is undefined, it defaults to the name of the scheme.

METHODS

create_element

Helper method that creates XML elements, e.g. to be used in the paragraphs element of the XML::NewsML_G2::News_Item.

create_dom

Returns the XML::LibXML::Document element containing the requested output.

AUTHOR

Philipp Gortan <philipp.gortan@apa.at>

LICENCE AND COPYRIGHT

Copyright (c) 2013, APA-IT. All rights reserved.

See XML::NewsML_G2 for the license.