xsl-list
[Top] [All Lists]

RE: [xsl] Conditional Execution in XSLT 2.0

2010-03-14 03:19:26
Try creating multiple entry points to your stylesheet, either as named
templates or as named modes, and invoking the transformation using -it
(initial template) or -im (initial mode). The secondary entry point might do
something as simple as displaying the content of a global variable.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

-----Original Message-----
From: Jacobus Reyneke [mailto:jacobusreyneke(_at_)gmail(_dot_)com] 
Sent: 14 March 2010 01:39
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Conditional Execution in XSLT 2.0

Hi,

I'm currently writing my content in XML, while at the same 
time writing XSLT to transform this content into a written 
manual. The problem is that sometimes I just want to quickly 
print out part of my document using XSL-FO to PDF.

For example, what if I just quickly want to build the table 
of contents, of if I just want to get certain element types, 
sometimes only the structure of my XML, sometimes just the 
images. Things like that.

Currently I'm commenting out parts of the XSLT, but there 
must be a better way. Should I split my XSLT into different 
libraries and conditionally include them based on parameters, 
or should I try and set variables throughout the doc using 
things such as visible/invisible? is there a tried and tested 
way when working with ever changing XML and XSLT while still 
creating and building the content and transformations?

What I just had to do as an example, was to comment out my "body text"
templates and "list templates" and "image" templates" etc, 
just so I could print out the document structure without any 
content. Am I being stupid here?

Best,
Jacobus

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>