Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XSLT Question XSLT QuestionTo: NULL Date: 7/17/2009 2:45:00 AM Hello, I'm trying to transform XML that can come in server forms, The XML i get is along these lines (This is example simplified code) <composer> <composer_if>jim</composer_if> <composer_epithet>mr</composer_epithet> </composer> or <artist> <artist_if>bob</artist_if> <artist_epithet>sir</artist_epithet> </artist> (or any number of different permutations of this) I'm trying to use this code to display it in the form Mr, Jim or Sir, Bob: <xsl:template match="advertiser|artist|box_office|company|composer| distributor|editor|for_benefit_of|lessee|owner|premises_owner| producer_director|scenery_designer|signatory"> <xsl:choose> <xsl:when test="main[@display = 'yes']"> <xsl:apply-templates select="main"/> </xsl:when> <xsl:otherwise> <xsl:variable name="if"> <xsl:value-of select="name()"/><xsl:text>_if</xsl:text> </xsl:variable> <xsl:variable name="epithet"> <xsl:value-of select="name()"/><xsl:text>_epithet</xsl:text> </xsl:variable> <xsl:apply-templates select="$if"/>, <xsl:apply-templates select="$epithet"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates/> </xsl:template> But the XSLT proccessor doesn't like using variable's in its "select" attribute. Does anyone know a way around this without changing the XML being passed in? Thanks Graeme | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
