[Home] [By Thread] [By Date] [Recent Entries]
Hello George!
You're right, following the description of my problem in more detail: First, I've a XML-File like this: <?xml version="1.0" encoding="ISO-8859-1"?> <Document> <textNo>text-1</textNo> </Document> Processing this with XSL like this snippet: <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". Thanks for you suggestions george. Doing the job in two transformation doesn't please me. Isn't there no way without a processor extension? Cant believe that... :'( Hoped there was a way like this:
<xsl:copy-of select="${<xsl:copy-of select='textNo'/>}"/>Greetings, Christian George Cristian Bina schrieb: Hi Christian,
|

Cart



