This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XSL variable...




 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]