[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL variable...

Subject: Re: XSL variable...
From: "Philippe D'Hont" <philippe.dhont@xxxxxxxx>
Date: Thu, 22 Jun 2000 08:59:20 +0200
philippe d hont

 Hi,

 Thanks for your reply, my script as to be processed by the XSL parser
(XALAN for me).


Here follow a part of my original XSL file :
----------------------------------------------------------------------------
---------

I declare my variable in the beginning of the tree

 	<xsl:variable name="wasLeft" select="'0'"/>

	<xsl:template match="text">
		<xsl:if test="@tts[.='true']">
			<SCRIPT>
				AddString('<xsl:eval>Filter(this)</xsl:eval>');
			</SCRIPT>
		</xsl:if>
		<xsl:choose>
			<xsl:when test="@visible[.='false']">
				<!-- Do nothing -->
			</xsl:when>
			<xsl:when test="$wasLeft='1'">
				<TD>
				<SPAN CLASS="text">
					<xsl:apply-templates/>
				</SPAN>
				</TD>
				<SCRIPT LANGUAGE="JavaScript">
					document.write(ltchar + "/TR" + gtchar);
					document.write(ltchar + "/TABLE" + gtchar);
				</SCRIPT>
				<xsl:variable name="wasLeft" select="'0'"/>
			</xsl:when>
			<xsl:otherwise>
				<SPAN CLASS="text">
					<xsl:apply-templates/>
				</SPAN>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="image">
	    <xsl:choose>
			<xsl:when test="@position[.='left']">
				<xsl:variable name="wasLeft" select="'1'"/>
				<SCRIPT LANGUAGE="JavaScript">
					document.write(ltchar + "TABLE" + gtchar);
					document.write(ltchar + "TR" + gtchar);
				</SCRIPT>
				<TD>
				<SPAN CLASS="image">
					<IMG BORDER="0">
						<xsl:attribute name="SRC">
							<xsl:value-of select="@file"/>
						</xsl:attribute>
						<xsl:if test="area">
							<xsl:attribute name="USEMAP">#map-<xsl:value-of
select="@file"/></xsl:attribute>
						</xsl:if>
					</IMG>
					<!--SPAN ID="mapDescArea">
						<xsl:value-of select="text"/>
					</SPAN-->
					<!-- Define map and areas, if one -->
					<xsl:if test="area">
						<MAP>
							<xsl:attribute name="NAME">map-<xsl:value-of
select="@file"/></xsl:attribute>
							<xsl:apply-templates select="area"/>
						</MAP>
					</xsl:if>
					<xsl:choose>
						<xsl:when test="@visible[.='false']">
							<!-- Do nothing -->
						</xsl:when>
						<xsl:otherwise>
							<BR/>
							<xsl:value-of select="text"/>
						</xsl:otherwise>
					</xsl:choose>
					<xsl:if test="click">
						<xsl:apply-templates select="click"/>
					</xsl:if>
				</SPAN>
				</TD>
			</xsl:when>
			<xsl:otherwise>
				<SPAN CLASS="image">
					<IMG>
						<xsl:attribute name="SRC">
							<xsl:value-of select="@file"/>
						</xsl:attribute>
						<xsl:if test="area">
							<xsl:attribute name="USEMAP">#map-<xsl:value-of
select="@file"/></xsl:attribute>
						</xsl:if>
					</IMG>
					<xsl:if test="area">
						<MAP>
							<xsl:attribute name="NAME">map-<xsl:value-of
select="@file"/></xsl:attribute>
							<xsl:apply-templates select="area"/>
						</MAP>
					</xsl:if>
					<xsl:choose>
						<xsl:when test="@visible[.='false']">
							<!-- Do nothing -->
						</xsl:when>
						<xsl:otherwise>
							<BR/>
							<xsl:value-of/>
						</xsl:otherwise>
					</xsl:choose>
					<xsl:if test="click">
						<xsl:apply-templates select="click"/>
					</xsl:if>
				</SPAN>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:if test="@tts[.='true']">
			<SCRIPT>
				AddString('<xsl:value-of select="@description"/>');
			</SCRIPT>
		</xsl:if>
	</xsl:template>
----------------------------------------------------------------------------
---------

	So my problem is with the wasLeft variable.
	But the test doesn't work ?

	Anyone who had a suggestion is welcome.

									Kinds Regards
										D'Hont Philippe.



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


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.