|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: moving presentation logic from ASP script to XSL
Hi Gabriel,
Nobody answered this question as far as I can see. So let me try.. Yes, you could pass a parameter and use that in a certain template (for instance match="/") to decide for one or the other presentation logic. You can prevent conflicts with same matche rules by adding a mode to the templates. Note that you will have to add the same mode to all templates that belong together and will have to specify that mode in each apply-templates as well. Basically it would look like: <xsl:param name="presentation-mode" select="'pc'" /> <!-- default 'pc', to be overruled from outside the script --> <xsl:template match="/">
<xsl:choose>
<xsl:when test="string($presentation-mode) = 'pocketpc'">
<xsl:apply-templates select="." mode="pocketpc" />
<xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="pc" />
</xsl:otherwise>
</xsl:choose>
</xsl:template><xsl:template match="/" mode="pc">
<html>
...
<xsl:apply-templates select="node()" mode="pc" />
...
</html>
</xsl:template><xsl:template match="/" mode="pocketpc">
<wap>
...
<xsl:apply-templates select="node()" mode="pocketpc" />
...
</wap>
</xsl:template>Hope this helps, good luck! Grtz, Geert Hello! My question is illustrated at http://gabbah.no-ip.org/XSL_question.jpg -- Geert.Josten@xxxxxxxxxxx IT-consultant at Daidalos BV, Zoetermeer (NL) http://www.daidalos.nl/ tel:+31-(0)79-3316961 fax:+31-(0)79-3316464 GPG: 1024D/12DEBB50
|
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








