Apache::AxKit::Provider::DOM - Base Class For Parsed XML Providers
use base Apache::AxKit::Provider::DOM;
Apache::AxKit::Provider::DOM allows to pass a parsed XML document directly to AxKit. It can be used as a base class for application providers, that create XML documents in memory. So Apache::AxKit::Provider::DOM provides an easy way to write application providers for AxKit 1.6.
Commonly an inheritated class only implements the provider function 'init()' and if required the provider function 'get_styles()'.
To make the provider work properly a class must provide the document tree in the special provider key 'dom_tree'.
A sample DOM provider could be:
package MyDomProvider; use vars (@INC); use XML::LibXML; use Apache::AxKit::Provider::DOM; @INC = ('Apache::AxKit::Provider::DOM'); sub init { my $class = shift; $class->{dom_tree} = XML::LibXML->new; $class->{dom_tree}->setDocumentElement( $class->{dom_tree}->createElement( 'foo' ); ); } 1;
This sample provider would cause AxKit to use the default style as provided in the style map of the server configuration.
If a provider based on Apache::AxKit::Provider::DOM and does not set the 'dom_tree' key as shown in the example AxKit will not process this ressource.
AxKit, Apache::AxKit::Provider
To install Apache::AxKit::Provider::DOM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::AxKit::Provider::DOM
CPAN shell
perl -MCPAN -e shell install Apache::AxKit::Provider::DOM
For more information on module installation, please visit the detailed CPAN module installation guide.