Sleepycat::XmlDocument.3pm

Langue: en

Version: 2008-10-21 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

XmlDocument - A Perl interface to the DbXml XmlDocument Class

SYNOPSIS

     use Sleepycat::DbXml;
 
     my $mgr = new XmlManager()
     my $doc = $mgr->createDocument()
 
     $doc->fetchAllData();
 
     my $xmlvalue = new XmlValue(...);
     $doc->getMetaData($uri, $name, $value);
     my $string ;
     $doc->getMetaData($uri, $name, $string);
 
     my $string = $doc->getContent;
     my $stream = $doc->getContentAsXmlInputStream;
 
     my $string = $doc->getName;
 
     $doc->removeMetaData($uri, $name);
 
     $doc->setMetaData($uri, $name, $xmlvalue);
     $doc->setMetaData($uri, $name, $scalar);
 
     $doc->setContent($string);
     $doc->setContentAsXmlInputStream($stream);
     $doc->setContentAsEventReader($eventReader);
         my $XmlEventReader  = $doc->getContentAsEventReader();
         $doc->getContentAsEventWriter($xmlEventWriter);
 
 
     $doc->setname($string);
 
 

DESCRIPTION

CONFORMANCE to C++ API

The Perl interface to XMlValue is identical to the C++ API, apart from the following
1.
getContentAsDOM and setContentAsDOM are not supported.

Constructor

The constructor for XmlDocument can takes the following form:
     my $mgr = new XmlManager;
     my $doc = $mgr->createXmlDocument() ;
 
 

In addition an XmlDocument object is returned from XmlContainer::getDocument.

Methods


$doc->fetchAllData();


$doc->fetchAllData();


$doc->getMetaData($uri, $name, $value);


$doc->getMetaData($uri, $name, $value);

The getMetaData method can take two forms. The first two parameters, $uri and $name, are identical for all three variants. Where they differ is in the final parameter, $value.

If the $value parameter is an XmlValue object the meta data will be written to the XmlValue object.

Otherwise the metadata will be written as a perl string into the $value parameter.

my $dbt = $doc->getContent;


my $dbt = $doc->getContent;

Returns the content of the document as a Perl string.

my $stream = $doc->getContentAsXmlInputStream;


my $stream = $doc->getContentAsXmlInputStream;


my $string = $doc->getName;


my $string = $doc->getName;


$doc->removeMetaData($uri, $name);


$doc->removeMetaData($uri, $name);


$doc->setMetaData($uri, $name, $value);


$doc->setMetaData($uri, $name, $value);

The setMetaData method can take two forms. The first two parameters, $uri and $name, are identical for all three variants. Where they differ is in the final parameter, $value.

The third parameter, $value can be an XmlValue object or a simple Perl string.

$doc->setContent($string);


$doc->setContent($string);


$doc->setContentAsXmlInputStream($stream);


$doc->setContentAsXmlInputStream($stream);


$doc->setname($string);


$doc->setname($string);

NOTES

EXAMPLES

SEE ALSO

AUTHOR

Paul Marquess