Subject: Re: [xsl] Need help for XSL beautifaction From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 17 May 2006 14:46:08 -0400 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<!-- Define Text-Modules -->
<xsl:variable name="text-1">This is long text number one.</xsl:variable>
<xsl:variable name="text-2">This is an other very long text.</xsl:variable>
<xsl:variable name="text-3">This is my third text without sense.</xsl:variable>
...
<!-- Hard-coded text-module selection -->
<xsl:choose>
<xsl:when test="textNo = 'text-1'">
<xsl:copy-of select="$text-1"/>
</xsl:when>
<xsl:when test="textNo = 'text-2'">
<xsl:copy-of select="$text-2"/>
</xsl:when>
<xsl:when test="textNo = 'text-3'">
<xsl:copy-of select="$text-3"/>
</xsl:when>
</xsl:choose>
I dont like the the hard-coded tests to the value of the element "textNo", hope there is a way directly to use the <xsl:copy-of> to the variable with the name, which is the same as the value in the element "textNo".
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- Define Text-Modules --> <xsl:variable name="snip-lookup"> <snip name="text-1">This is long text number one.</snip> <snip name="text-2">This is an other very long text.</snip> <snip name="text-3">This is my third text without sense.</snip> </xsl:variable>
<xsl:variable name="snippets" select="document('')/*/xsl:variable[@name='snip-lookup']/snip"/>
Regards, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Need help for XSL beautif, Jon Gorman | Thread | RE: [xsl] Need help for XSL beautif, Michael Kay |
Re: [xsl] Need help for XSL beautif, Jon Gorman | Date | RE: [xsl] Collect word count with x, Karen McAdams |
Month |