[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
I've been using a setup of stylesheets that take command line parameters (using Saxon) to process a single file into HTML format that is then compiled into MS Help. I used 2 or 3 global parameters to manage things like the where to write the file, how to format, etc.
This process has been working fine because I have had a single document that I want to process. Now I need to process a group of documents into the help format. These documents have sections that should cross-reference each, so processing individually is not an option I want to look at.
My problem is that each document may have a slightly different combination of control parameters. I've started converting my process over to use a configuration file that lists the objects to process and their individual parameters.
In making this conversion I've noticed a major programming change. Where I could just rely upon the parameters being available in the old model, I now have to pass these parameters between templates directly. The problem is that I don't have a template for every level in my document. What happens is if I do not explicitly pass a parameter through a template (called in document order, not by name or anything else) then that template doesn't have access to the parameters value.
What I would at least like to do is convert all my <xsl:apply-templates/> to something like this:
I used to get away with not having to have explicit templates for Div and Listing to have a template for head work just fine.
Any ideas on how to re-arrange things so I don't have to add all these "default like" templates?
I would really like the apply-templates to create its own default template setup where not only do modes get automatically added, how about picking up the set of parameters as well?
Barring that from working, it would be nice to somehow use the <xsl:include> somewhere other than the top of a stylesheet and use document() to specify the include as well as the parameters that should be used for that particular document.
Anyone got another idea for how to tackle this? My current design is going to be very buggy, depending upon how stable the DTD remains in the future.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
[xsl] managing parameters to stylesheets
Subject: [xsl] managing parameters to stylesheets From: Dan Vint <dvint@xxxxxxxxx> Date: Fri, 19 Mar 2004 18:39:27 -0800 |
I've been using a setup of stylesheets that take command line parameters (using Saxon) to process a single file into HTML format that is then compiled into MS Help. I used 2 or 3 global parameters to manage things like the where to write the file, how to format, etc.
This process has been working fine because I have had a single document that I want to process. Now I need to process a group of documents into the help format. These documents have sections that should cross-reference each, so processing individually is not an option I want to look at.
My problem is that each document may have a slightly different combination of control parameters. I've started converting my process over to use a configuration file that lists the objects to process and their individual parameters.
In making this conversion I've noticed a major programming change. Where I could just rely upon the parameters being available in the old model, I now have to pass these parameters between templates directly. The problem is that I don't have a template for every level in my document. What happens is if I do not explicitly pass a parameter through a template (called in document order, not by name or anything else) then that template doesn't have access to the parameters value.
What I would at least like to do is convert all my <xsl:apply-templates/> to something like this:
<xsl:apply-templates> <xsl:with-param name="dir" select="$dir"/> </xsl:apply-templates>
If I have a structure like: Body Sect Div head Listing head
I used to get away with not having to have explicit templates for Div and Listing to have a template for head work just fine.
Any ideas on how to re-arrange things so I don't have to add all these "default like" templates?
I would really like the apply-templates to create its own default template setup where not only do modes get automatically added, how about picking up the set of parameters as well?
Barring that from working, it would be nice to somehow use the <xsl:include> somewhere other than the top of a stylesheet and use document() to specify the include as well as the parameters that should be used for that particular document.
Anyone got another idea for how to tackle this? My current design is going to be very buggy, depending upon how stable the DTD remains in the future.
..dan --------------------------------------------------------------------------- Danny Vint http://www.dvint.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] using xsl and javascript , Michael Kay | Thread | Re: [xsl] managing parameters to st, Wendell Piez |
RE: [xsl] using xsl and javascript , Michael Kay | Date | Re: [xsl] managing parameters to st, Wendell Piez |
Month |