xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Making XPath expressions out of variables


Subject: [xsl] Making XPath expressions out of variables
From: Richard Lewis <richard.lewis@xxxxxxxxx>
Date: Wed, 29 Oct 2003 13:09:29 +0000

This is a theoretical bit of XSL code which I need a practical version of:

All the variables are passed as parameters to the stylesheet.

<xsl:for-each select="//$record-type">
	<xsl:sort select="$sort-by" order="$sort-order" />
	<xsl:if test="$lh-operator $operand $rh-operator">
		<tr>
 			<xsl:for-each select="*">
				<td><xsl:value-of select="." /></td>
			</xsl:for-each>
		</tr>
	</xsl:if>
</xsl:for-each>

Any ideas? Is it possible? Or do I need to use this basic construct multiple 
times using <xsl:if> for each variable and the correct names of nodes and 
operands. (The number of permutations is massive!)

Cheers,
Richard
-------------------------------------------------------------
This is question I was going to ask (it might make things clearer):

Is there a way of selecting nodes which have the name $some-variable using an 
XPath expression?

e.g. <xsl:for-each select="//$some-variable">

would, in theory (though not in practice - I've tried it!), select all the 
nodes whose name is equal to whatever the value of $some-variable is.
-------------------------------------------------------------


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor