XML::DB::Resource::XMLResource - Wrapper class for xml documents or document fragments |
XML::DB::Resource::XMLResource - Wrapper class for xml documents or document fragments
$resource = $collection->getResource($id); $dom = $resource->getContentAsDOM(); $resource->setContentAsDOM($dom); $resource->getDocumentId();
This class implements the Resource interface from the XML:DB base specification.
No implementation of SAX interface
Graham Seaman CPAN ID: GSEAMAN graham@opencollector.org
Copyright (c) 2002 Graham Seaman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
XML::DB::Resource
Usage : $r->getContentAsDOM()
Purpose : Returns the stored data as a DOM node
Argument : None
Returns : DOM node
Usage : $r->setContentAsDOM($dom)
Purpose : Stores the DOM node
Argument : DOM node
Returns : undef
Usage : $saxHandler = $r->getContentAsSAX()
Purpose : Returns a SAX handler for the stored data
Argument : None
Returns : SAX handler
Usage : $r->setContentAsSAX($saxHandler)
Purpose : Stores contents created by the SAX handler
Argument : SAX handler
Returns : undef
Usage : $r->getDocumentId()
Purpose : Returns the unique id for the parent document to this Resource or null if the Resource does not have a parent document. getDocumentId()
is typically used with Resource instances retrieved using a query. It enables accessing the parent document of the Resource even if the Resource is a child node of the document. If the Resource was not obtained through a query then getId()
and getDocumentId()
will return the same id.
Argument : None
Returns : documentId, Id or undef
Purpose : Constructor
Comments : The constructor should not be called directly; new Resources are created via their parent Collection, or implicitly while building a ResourceSet.
Usage : $r->getContentAsHTML()
Purpose : Returns the stored data with angle brackets escaped
Argument : None
Returns : HTML-viewable string
Comments : What about pretty-printing? This just adds line breaks. And what about all the other entities? And non ASCII chars? :-(
XML::DB::Resource::XMLResource - Wrapper class for xml documents or document fragments |