RE: [xsl] Embedded Xsl

Subject: RE: [xsl] Embedded Xsl
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 26 Feb 2004 09:18:48 -0000
The answer depends on which XSLT processor you are using. But most processor
APIs provide some way of separating the parsing and transformation phases,
so that you can parse a source document once into a tree in memory, and then
transform it multiple times using different stylesheets.

Doing the 7 transformations using different stylesheets is probably just as
good as combining the stylesheets into one (which you could do, for example,
using modes). In Saxon, one advantage of combining them is that you could
re-use the indexes built to support keys.

A caveat if you are using Saxon is that the obvious (portable) way to do
this is to build a DOM first, and then supply the DOM as input to each of
the transformations. But a DOM is much bigger and much less efficient than
using Saxon's own tree model. I'm fairly sure that similar considerations
apply to other XSLT processors too.

Michael Kay

# -----Original Message-----
# From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-
# list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Dipesh Khakhkhar
# Sent: 25 February 2004 22:22
# To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
# Subject: [xsl] Embedded Xsl
# Hi,
# I am having a process where in i have written 7 xsl to get 7 output files
# from
# one input xml files (usually greater than 100 MB). My overall process is
# slow
# now. I tried to do best optmization like not using // and etc.
# How can i make this simple by running it only once. I mean can i do
# something
# like loading input xml into memory only once and then run seven xsl on it.
# Can i call one xsl from other xsl i.e. running first xsl on xml i will all
# another xsl from the first xsl and so on.
# I hope my question is clear. Thanks in the anticipation that I will get
# hints
# to solve this problem.
# Regards,
# Dipesh
#  XSL-List info and archive:

 XSL-List info and archive:

Current Thread