[xslt] Sharing common XSL templates in memory
- From: Jun Zhang <j_zhang1999 yahoo com>
- To: xslt gnome org
- Subject: [xslt] Sharing common XSL templates in memory
- Date: Tue, 29 Nov 2005 16:49:12 -0800 (PST)
Hi All,
We have a web server that uses 2000 XSL files to
generate different web pages ---- one XSL file for one
web page. Those XSL files share ('include') a lot of
common templates in other 1000 XSL files. We are
trying to cache the parsed objects (xsltStylesheetPtr)
for those 2000 XSL files. Since all the 'included'
common templates are having duplicate copies for each
of those 2000 XSL files, those objects are too big to
cache. I wonder if there is a way for those 2000 XSL
objects to share those common templates in memory so
the overall memory consumption can be reduced
significantly.
What we wish to see is an API like the following (but
certainly other API models that serve the same purpose
are fine too):
We have 2000 XSL files for all the web pages: p1.xsl,
p2.xsl, ..., p2000.xsl,
and we have 1000 XSL files for the common templates:
c1.xsl, c2.xsl, ..., c1000.xsl.
XsltTemplateContext xtctxt = xsltNewTemplateContext();
xsltStylesheetPtr p1 = xsltParseFile(xtctxt,
"p1.xsl"); (1)
xsltStylesheetPtr p2 = xsltParseFile(xtctxt,
"p2.xsl"); (2)
.....
xsltStylesheetPtr p2000 = xsltParseFile(xtctxt,
"p2000.xsl");
if p1.xsl and p2.xsl both includes c1.xsl, c2.xsl,
..., c1000.xsl (the 'include' might be cascading, e.g.
p1.xsl and p1.xsl includes c1.xsl, c1.xsl includes
c2.xsl and c3.xsl, etc.)
We are hoping after step (1), the common templates can
be referenced by xtctxt, therefore in step (2), the
parsed objects for those common templates can be
directly referenced by p2.
Note. XsltTemplateContext, xsltNewTemplateContext(),
xsltParseFile() are my make-up data structure and
functions for illustration.
Does API like the above exist in libxslt ? Or is there
other workaround ?
Thanks,
Jun Zhang
__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]