This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: XSLT 2.0 question


Hi Bryan,

> For many reasons too voluminous to go into here I can't change the
> structure of how stylesheets are run in this app, that is to say the
> main stylesheet needs to be the external one, I don't see anyway
> this could be done from xslt 1.0, although I could prob. construct a
> hack whereby the app reads in the xslt, reads xml document, creates
> a node <xsl:import name=" <<put the name of the xml document
> here>>"/> and then have to do some parameter checking to tell me to
> switch between apply-imports and apply-templates at points in the
> document. sounds awful, is awful, that's why it's called a hack :)
> also introduces the dreaded side effects, not to mention being
> potentially the slowest thing ever. Don't want to do anything with
> side effects, thought there might be some way to achieve it in xslt
> 2.0 without side effects.

There's no way in either XSLT 1.0 or XSLT 2.0 to 'interpret' XSLT
templates on the fly. So as far as I can see, if the stylesheet has to
be the external stylesheet then you have to use that stylesheet to
create an XSLT stylesheet that you can then use on the XML document:

  main stylesheet -> (process) -> created stylesheet
                         ^                |
                         |                v
                    XML document  ->  (process) -> result

The stylesheet that you create using the main stylesheet could simply
import the stylesheet that you want to use for all the documents, and
then include the templates that were defined within the XML document
itself. Essentially, you'd be generating the 'embedded stylesheet'
from the previous example, but it wouldn't actually be embedded.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]