ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tclxml-announce
tclxml-announce
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved