|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: variable definition reuse
> > <xsl:template match="//programme"> > <!-- VARIABLE DECLARATION --> > <xsl:variable name = "color" select = "color"> > <xsl:variable name = "weight" select = "weight"> > <xsl:variable name = "cost" select = "cost"> > <xsl:variable name = "acceptance" select = "acceptance"> > <xsl:variable name = "mnf-date" select = "mnf-date"> > <xsl:variable name = "exp-date" select = "exp-date"> > <xsl:variable name = "lable-design" select = "lable-design"> > <xsl:variable name = "mkt-agncy" select = "mkt-agncy"> > <xsl:variable name = "serial-id" select = "serial-id"> > <xsl:variable name = "order-qty" select = "order-qty"> > <xsl:variable name = "re-order-level" select = "re-order-level"> > .<!-- VARIABLE DECLARATION ENDS --> > . > .----- do some formating on these variables and display > This block IS > THE ONLY THING THAT CHANGES IN ALL THE 20 FILES ) ---------- > . > </xsl:template> > This block remains same in all the 20 files. Now what i > wanted to do is that > define these variables in a separate file so that all the 20 > XSL files can > access/share these variables. The only variables you can share across XSLT stylesheet modules are global variables. Global variables have a single value that is constant for the whole transformation. The variables above have a different value each time the template rule is instantiated, because they are defined relatively to the <programme> element. As David pointed out, there is very little point defining these variables. All it does is enable you to write $exp-date instead of exp-date, which gives you neither an improvement in stylesheet legibility nor an improvement in performance. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








