[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] How to simplify this?


Subject: [xsl] How to simplify this?
From: "anton" <a.m@xxxxxxxxxxx>
Date: Tue, 21 Sep 2004 18:13:27 +0200

Hi!

In the HTML-output I need a javascript function with ' mark. My template get
two parameters, which I wish in single-quoted mark. So I define additional
three variables for this. Is there a better way to do this?

I use MSXML 4.0 and XSL 1.0

My xsl-template:

<xsl:template match="QTableBox/ROW[*[1][@Type='Label']]" >
	<xsl:param name="tbody_id" />
	<xsl:param name="thead_id" />
	<xsl:variable name="apos">&#x27;</xsl:variable>
	<xsl:variable name="qbody_id" select="concat( $apos, $tbody_id,
$apos )" />
	<xsl:variable name="qhead_id" select="concat( $apos, $thead_id,
$apos )" />
	
	<tr class="tableHead">
		<xsl:for-each select="*">
			<xsl:variable name="colPos" select="position()-1"/>
			<th nowrap="nowrap">
				<a href="" onclick="setArrow( {$colPos},
{$qhead_id} ); return sortTable( {$qbody_id}, {$colPos} );">

				<div style="{ $ownStyle }">
					<xsl:copy-of select="node()" />
					<span
style="visibility:hidden;"><xsl:text
disable-output-escaping="yes">&amp;nbsp;&amp;uarr;</xsl:text></span>
				</div>
				</a>
			</th>
		</xsl:for-each>
	</tr>
</xsl:template>

best regards 
A. Metz


Current Thread
Keywords
xsl