DTA::CAB::Format::XmlCommon - Datum parser|formatter: XML: base class
use DTA::CAB::Format::XmlCommon;
##========================================================================
## Constructors etc.
$fmt = DTA::CAB::Format::XmlCommon->new(%args);
##========================================================================
## Methods: Input
$fmt = $fmt->close();
$fmt = $fmt->fromFile($filename_or_handle);
$fmt = $fmt->fromFh($filename_or_handle);
$fmt = $fmt->fromString($string);
##========================================================================
## Methods: Output
$fmt = $fmt->flush();
$fmt = $fmt->toString(\$str);
$fmt = $fmt->toFile($file);
$fmt = $fmt->toFh($fh);
$xmldoc = $fmt->xmlDocument();
$rootnode = $fmt->xmlRootNode();
$nod = $fmt->defaultXmlNode($value,\%opts);
DTA::CAB::Format::XmlCommon is a base class for XML-formatters using XML::LibXML, and is not a fully functional format class by itself. See subclass documentation for details.
DTA::CAB::Format::XmlCommon inherits from DTA::CAB::Format.
$fmt = CLASS_OR_OBJ->new(%args);
Constructor.
%args, %$fmt:
##-- input
xdoc => $xdoc, ##-- XML::LibXML::Document
xprs => $xprs, ##-- XML::LibXML parser
##
##-- output
encoding => $inputEncoding, ##-- default: UTF-8; applies to output only!
level => $level, ##-- output formatting level (default=0)
##
##-- common
#(nothing here)
@keys = $class_or_obj->noSaveKeys();
Override: returns list of keys not to be saved. Here, qw(xdoc xprs)
.
$fmt = $fmt->close();
Override: close current input source.
$fmt = $fmt->fromFile($filename_or_handle);
Override: select input from file.
$fmt = $fmt->fromFh($fh);
Override: select input from filehandle $fh.
$fmt = $fmt->fromString($string);
Override: select input from string $string.
$fmt = $fmt->flush();
Override: flush accumulated output.
$str = $fmt->toString();
$str = $fmt->toString($formatLevel);
Override: flush buffered output to byte-string. $formatLevel is passed to XML::LibXML::Document::toString(), and defaults to $fmt->{level}.
$fmt_or_undef = $fmt->toFh($fh,$formatLevel);
Override: flush buffered output document to filehandle $fh.
$xmldoc = $fmt->xmlDocument();
Returns output buffer $fmt->{xdoc}, creating it if not yet defined.
$rootnode = $fmt->xmlRootNode();
$rootnode = $fmt->xmlRootNode($nodname);
Returns output buffer root node, creating one if not yet defined.
$nodname is the name of the root node to create (if required); default='doc'.
Not implemented here.
Not implemented here.
Not implemented here.
$nod = $fmt->defaultXmlNode($value,\%opts);
Default XML node generator, which creates very perl-ish XML.
%opts is unused.
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2009-2019 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.1 or, at your option, any later version of Perl 5 you may have available.