Taxi::Mysql::Format::XML - hit list formatter: XML |
Taxi::Mysql::Format::XML - hit list formatter: XML (flat)
##======================================================================== ## PRELIMINARIES
use Taxi::Mysql::Format::XML;
##======================================================================== ## Constructors etc.
$q = $CLASS_OR_OBJ->new(%args);
##======================================================================== ## XML Generation
$hitElt = $fmt->hitElement($hit); $hitListElt = $fmt->hitListElement($hitList); $hitListDoc = $fmt->hitListDocument($hitList);
##======================================================================== ## API
$mimeType = $fmt->contentType(); $doc = $fmt->toDocument($hits); $str = $fmt->toString($hits); $bool = $fmt->toFile($hits,$file); $bool = $fmt->toFh($hits,$fh);
Taxi::Mysql::Format::XML is a class for formatting HitList objects as a ``flat'' series of XML records.
Taxi::Mysql::Format::XML inherits from and implements the API specified by Taxi::Mysql::Format::Base.
$q = $CLASS_OR_OBJ->new(%args);
Object structure / known %args:
{ ##-- XML formatting xmlVersion => $version, ##-- output XML version (default="1.0") xmlEncoding => $encoding, ##-- output XML encoding (default="UTF-8") xmlHitListElt => $listElt, ##-- element for whole HitList (root); default='hitlist' xmlHitElt => $hitElt, ##-- element for single hits; default='hit' xmlTokElt => $tokElt, ##-- element for single tokens; default='tok' xmlHitNAttr => $hitNAttr, ##-- hit-number attribute (default="n") pretty => $level, ##-- $format argument for XML::LibXML::Document->toXXX()
##-- Source data (from ../Format) index => $index, ##-- underlying Taxi::Mysql object }
$hitElt = $fmt->hitElement($hit);
Generate and return an XML::LibXML::Element representing a single Hit $hit.
$hitListElt = $fmt->hitListElement($hitList);
Generate and return an XML::LibXML::Element representing the HitList $hitList.
Default implementation calls $fmt->hitElement()
for each hit in $hitList.
$hitListDoc = $fmt->hitListDocument($hitList);
Generate and return an XML::LibXML::Document representing $hitList. Default implementation calls $fmt->hitListElement().
$mimeType = $fmt->contentType();
Default returns 'text/xml'.
$doc = $fmt->toDocument($hits);
New API method in Taxi::Mysql::Format::XML. Default implementation wraps hitListDocument().
$str = $fmt->toString($hits);
Convert '$hits' to a string.
$bool = $fmt->toFile($hits,$file);
$bool = $fmt->toFh($hits,$fh);
Perl by Larry Wall.
Bryan Jurish <moocow@ling.uni-potsdam.de>
Copyright (C) 2006 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.8.7 or, at your option, any later version of Perl 5 you may have available.
perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Format(3perl), Taxi::Mysql::Format::Base(3perl), Taxi::Mysql::Format::Text(3perl), Taxi::Mysql::Format::XMLBibl(3perl), Taxi::Mysql::Format::XSLT(3perl), Taxi::Mysql::Format::XSLTBibl(3perl), Taxi::Mysql::Format::HTML(3perl).
Taxi::Mysql::Format::XML - hit list formatter: XML |