[Tclxml-announce] New TclXSLT Utility
by Steve Ball other posts by this author
Nov 12 2002 8:27PM messages near this date
[Tclxml-announce] TclXML v2.5
|
[Tclxml-announce] ANN: TclDOM, TclXSLT v2.4
I've added a new utility sub-package to the TclXSLT
CVS repository - xslt::cache. This module takes care
of loading the documents for performing an XSL transformation,
and caches the documents and stylesheets for those times
when the transformation is to be repeated.
Example:
package require dom
package require xslt
package require xslt::cache
# Transform doc.xml using stylesheet style.xsl with
# parameter foo='bar'
set result1 [xslt::cache::transform doc.xml style.xsl foo bar]
# This time the source and stylesheet will be taken from the cache,
# only the transformation itself is repeated
set result2 [xslt::cache::transform doc.xml style.xsl foo bar2]
---
The command xslt::cache::flush removes entries from the cache.
TODO: write up documentation, add info to website.
Volunteer(s) needed! It would be useful to extend the package
in two ways: the simplest improvement would be to allow
documents to be fetched via HTTP in addition to files.
A more complex improvement would be to track document dependencies.
Source documents may use external entities or XInclude and
stylesheets may import/include other stylesheets or use the
document() function. If any of these dependent files change
then the cache should be invalidated. Thus the cache module
needs to discover the document's dependencies and check them
at transform time. Most of the hooks are in place to interpose
on these functions, someone just needs to add the code to the
cache module to build a dependency graph and check it for
out-of-date files.
Enjoy,
Steve Ball
--
Steve Ball | XSLT Standard Library | Training & Seminars
Zveno Pty Ltd | Web Tcl Complete | XML XSL Schemas
http://www.zveno.com/ | TclXML TclDOM | Tcl, Web Development
Steve.Ball@[...].com +---------------------------+---------------------
Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 6242 4099
-------------------------------------------------------
This sf.net email is sponsored by:
To learn the basics of securing your web site with SSL,
click here to get a FREE TRIAL of a Thawte Server Certificate:
http://www.gothawte.com/rd522.html
_______________________________________________
Tclxml-announce mailing list
Tclxml-announce@[...].net
https://lists.sourceforge.net/lists/listinfo/tclxml-announce
|