This problem has been bugging me for some time, but it has only been
recently, since I have been doing some code profiling that I have
realised how much of a performance hit it is having on my server.
I need to include some pre-transformed content in my output - so I
started off by doing something like:
<xsl:copy-of select="document(
'http://my.server/path/to/resource.xml')/>
This worked OK, but there seemed to be a rather larger performance
hit since I was doing a full external request to my server. AxKit
uri's to the rescue... So I changed it to:
<xsl:copy-of select="document('
axkit:/path/to/resource.xml')/>
Great. This speeded things up a little and took some load of my
Apache server - Just like the docs said. No problem? wait for it...
resource.xml - The resource that I want to include in a pre-
transformed state, is a Docbook document which includes the standard
Docbook DTD. I have my xml catalog file configured nicely (the file
which resolves references to external DTD's etc to local copies of
the files). Setting AxKitDebug to level 10 and requesting the
resource directly from my server (typing http://my.server/path/to/
resource.xml into the browser) results in a nicely transformed
Docbook document. Looking into the server error logs, I can see that
the references to the Docbook DTD's have indeed been resolved to my
local copies.
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit]
[LibXSLT] getting the XML
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/xml/global/catalog.xml
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/dtd/docbook-xml-4.4/docbookx.dtd
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/dtd/docbook-xml-4.4/dbnotnx.mod
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/dtd/docbook-xml-4.4/dbcentx.mod
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/dtd/docbook-xml-4.4/ent/isoamsa.ent
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/dtd/docbook-xml-4.4/ent/isoamsb.ent
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/dtd/docbook-xml-4.4/ent/isoamsc.ent
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/dtd/docbook-xml-4.4/ent/isoamsn.ent
[Tue Jan 17 22:15:52 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: file:///www/dtd/docbook-xml-4.4/ent/isoamso.ent
....... etc etc
Now. As soon as I try to request in the transformed content from one
of my xsl stylesheets, things start to go wrong.
<xsl:copy-of select="document('
http://my.server/path/to/resource.xml')/>
or
<xsl:copy-of select="document('
axkit:/path/to/resource.xml')/>
also results in a nicely transformed Docbook document, but looking at
the error logs this time I can see that it has found my catalog file,
but it has not actually resolved the references to the Docbook DTD's
to my local copy, resulting in a rather slow transformation while my
server attempts to contact www.oasis.org.
[Tue Jan 17 22:17:19 2006] [warn] [client 194.203.134.135] [AxKit]
encoding to UTF-8
[Tue Jan 17 22:17:19 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
[Tue Jan 17 22:17:19 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: http://www.oasis-open.org/docbook/xml/4.4/dbnotnx.mod
[Tue Jan 17 22:17:19 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: http://www.oasis-open.org/docbook/xml/4.4/dbcentx.mod
[Tue Jan 17 22:17:19 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: http://www.oasis-open.org/docbook/xml/4.4/ent/isoamsa.ent
[Tue Jan 17 22:17:19 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: http://www.oasis-open.org/docbook/xml/4.4/ent/isoamsb.ent
[Tue Jan 17 22:17:19 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: http://www.oasis-open.org/docbook/xml/4.4/ent/isoamsc.ent
[Tue Jan 17 22:17:19 2006] [warn] [client 194.203.134.135] [AxKit] LibXSLT
match_uri: http://www.oasis-open.org/docbook/xml/4.4/ent/isoamsn.ent
....... etc etc
Being in control of three identical machines (development, staging
and live webservers) I tried changing:
<xsl:copy-of select="document(
'axkit:/path/to/resource.xml')/>
to
<xsl:copy-of select="document('
http://my.other.server/path/to/resource.xml')/>
This time, I took a look at the apache error logs from
my.other.server... The catalog resolves the Docbook DTD's to the
local files fine!
So to summarize. AxKit (or libxml2, or something) does not resolve
xml catalog files correctly when requesting pre-trnsformed content
from xslt's document() function (either using a full external address
or an axkit uri).
So now for a bombardment of questions ;)
Has anyone ever experienced this before?
Can someone test a similar thing in their AxKit environment for me to
see if they to have the same problem?
Is this issue known about by any of the core AxKit developers?
Has it been resolved in AxKit 1.7?
I'm running:
AxKit 1.6.2
Using libxml 20622, libxslt 10115 and libexslt 812
xsltproc was compiled against libxml 20622, libxslt 10115 and libexslt
812
libxslt 10115 was compiled against libxml 20622
libexslt 812 was compiled against libxml 20622)
thanks
--
Tom Kirkpatrick
Web Developer - Virus Bulletin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]