[jQuery] on the jQuery XSL plugin: xslt.js
Hi,
On http://johannburkard.de/software/xsltjs/ -- very nice and useful!
I was just looking at the source of this and want to offer a few
suggestions:
* ability to 'get' the compiled XSL so you can store in some cache for
reuse without going through the download/parse again. The most
expensive part of a transformation (other than downloading the xsl
file) is parsing it into a compiled instance. If you use it more than
once you should not have to download/parse again.
* ability to add parameters. In the case of a cached stylesheet you
also need the ability to remove parameters since they will stay in
the compiled xsl unless removed leading to unexpected results.
* (lesser) the ability to 'get' the XML source. A good way to increase
performance for any kind of XSL transformation is to use a small XML
document (<x/>) for the main source of a transform. Then use the
document function to pull in any other XML needed. This bypasses
larger XML DOM creation in JS and leaves it to the XSL processor which
can then create a processor optimized DOM which is usually much
smaller (usually like a list of sax events). The processor would do
this regardless when given an XML DOM as the main source of the
transform.
best,
-Rob