Hi!

Some time ago I wrote a custom content provider which
builds a DOM tree from scratch based on my application data.

It implements get_dom which, would be the most efficient way
to hand over the XML and get_strref by using the toString method.

Now I want to optimise timing and had to find out that
get_strref is allways called by the AxKit core.

It seems that the style handling code needs it, even
if I provide a get_styles which sets the styles without
using the super class method.

I even removed all AxAddProcessor statements from httpd.conf
but didnt get a change in behaviour.

The request logged in http error_log:

--- cut here ---
[Mon Feb  6 18:15:27 2006] [info] Using Apache::RequestNotes
[Mon Feb  6 18:15:27 2006] [info] Exiting Apache::RequestNotes
[Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] fast handler called for /nax/index.nax [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] Content Provider Override: elimpex::Apache::AxKit::Provider::Nina [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] checking if we process this resource [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] media: screen, preferred style: #default [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] Cache: key = a83e8d4ebbc3ee017deb50507435898d [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] getting styles and external entities from the XML [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] styles not cached - calling $provider->get_styles() [Mon Feb 6 18:15:29 2006] [debug] /home/elimpex/perl/lib/elimpex/Apache/AxKit/Provider/Nina.pm(233): [client 10.42.0.14] get_styles [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] resetting cache with no preferred style (#default ne ) [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] Cache: key = 16cdb7673390bbdc70a1435b5613ce2b [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] cache doesn't exist [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] some condition failed. recreating output [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] styles: (/styles/nax.xsl) [Mon Feb 6 18:15:29 2006] [debug] /home/elimpex/perl/lib/elimpex/Apache/AxKit/Provider/Nina.pm(203): [client 10.42.0.14] get_strref [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] Style Provider Override: Apache::AxKit::Provider::File [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] encoding to UTF-8 [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [uri] File Provider looking up uri (/styles/nax.xsl) [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] decoding from UTF-8 [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [uri] File Provider set filename to /home/elimpex/www/styles/nax.xsl [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] about to execute: Apache::AxKit::Language::LibXSLT::handler [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [LibXSLT] getting the XML [Mon Feb 6 18:15:29 2006] [debug] /home/elimpex/perl/lib/elimpex/Apache/AxKit/Provider/Nina.pm(167): [client 10.42.0.14] get_dom [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [LibXSLT] parsing stylesheet [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [LibXSLT] parsing stylesheet /styles/nax.xsl [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] Provider::get_dom [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] Provider::get_dom/parse_fh(GLOB(0x8d1be18), /styles/nax.xsl) [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [LibXSLT] performing transformation [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [LibXSLT] transformation finished, creating XML::LibXML::Document=SCALAR(0x8d1beb4) [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [LibXSLT] outputting to $r [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] [LibXSLT] storing results in pnotes(dom_tree) (AxKit::Apache=SCALAR(0x88e5bdc)) [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] Apache::AxKit::Language::LibXSLT::handler finished with code 0 [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] execution of: Apache::AxKit::Language::LibXSLT::handler finished [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] delivering to browser [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] Delivering xml_string [Mon Feb 6 18:15:29 2006] [warn] [client 10.42.0.14] [AxKit] writing xml string to browser
--- cut here ---

The lines with "[debug] /home/elimpex/perl/lib/elimpex/Apache/AxKit/Provider/Nina.pm" are at the start of the methods get_styles, get_strref and get_dom of my provider code.

As you may see, get_styles is called first, so AxKit should know which styles
to use for the pipeline. Then get_strref is called right after the styles
are defined. Then at last get_dom is called, to hand over the XML into
the built pipeline.

At least thats how I interprete this log - maybe someone can bring some more
light in here.

If I remove the get_strref method, I get this in http error_log:

--- cut here ---
[Mon Feb  6 18:01:36 2006] [info] Using Apache::RequestNotes
[Mon Feb  6 18:01:36 2006] [info] Exiting Apache::RequestNotes
[Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] fast handler called for /nax/index.nax [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] Content Provider Override: elimpex::Apache::AxKit::Provider::Nina [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] checking if we process this resource [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] media: screen, preferred style: #default [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] Cache: key = a83e8d4ebbc3ee017deb50507435898d [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] getting styles and external entities from the XML [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] styles not cached - calling $provider->get_styles() [Mon Feb 6 18:01:37 2006] [debug] /home/elimpex/perl/lib/elimpex/Apache/AxKit/Provider/Nina.pm(236): [client 10.42.0.14] get_styles [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] resetting cache with no preferred style (#default ne ) [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] Cache: key = 16cdb7673390bbdc70a1435b5613ce2b [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] cache doesn't exist [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] some condition failed. recreating output [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] styles: (/styles/nax.xsl) [Mon Feb 6 18:01:37 2006] [warn] [client 10.42.0.14] [AxKit] Caught an exception [Mon Feb 6 18:01:37 2006] [error] [client 10.42.0.14] [AxKit] [Error] Subclass must implement get_strref [Mon Feb 6 18:01:37 2006] [error] [client 10.42.0.14] [AxKit] From: /usr/lib/perl5/site_perl/5.8.0/Error.pm : 148 [Mon Feb 6 18:01:37 2006] [error] [client 10.42.0.14] [AxKit] [Backtrace] Subclass must implement get_strref at /usr/lib/perl5/site_perl/5.8.0/Error.pm line 148\n\tError::throw('Apache::AxKit::Exception::Error','-text','Subclass must implement get_strref') called at /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/Apache/AxKit/Provider.pm line 123\n\tApache::AxKit::Provider::get_strref('elimpex::Apache::AxKit::Provider::Nina=HASH(0x8514434)') called at /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/AxKit.pm line 720\n\tAxKit::process_request('AxKit::Apache=SCALAR(0x88e5bdc)','elimpex::Apache::AxKit::Provider::Nina=HASH(0x8514434)','ARRAY(0x83ac594)','undef') called at /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/AxKit.pm line 478\n\tAxKit::run_axkit_engine('AxKit::Apache=SCALAR(0x88e5bdc)','elimpex::Apache::AxKit::Provider::Nina=HASH(0x8514434)') called at /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/AxKit.pm line 304\n\teval {...} called at /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/AxKit.pm line 295\n\tAxKit::main_handler('AxKit::Apache=SCALAR(0x88e5bdc)','elimpex::Apache::AxKit::Provider::Nina=HASH(0x8514434)') called at /usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/AxKit.pm line 208\n\tAxKit::fast_handler('AxKit::Apache=SCALAR(0x88e5bdc)') called at /dev/null line 0\n\teval {...} called at /dev/null line 0\n
--- cut here ---

The AxKit man pages and the book clearly say any ONE of
get_strref, get_dom or get_fh must be implemented, so why
is AxKit insiting on get_strref if get_dom is available ?

Is there a way to do it with get_dom and without get_strref?

Which part of AxKit needs the XML as string and can it be
avoided ?

Thanks for any hints!


Bye, Peter
WOTLmade


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to