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

RE: [xsl] checking for a node in the ancestor axis


Subject: RE: [xsl] checking for a node in the ancestor axis
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Wed, 22 Oct 2003 06:10:33 -0500

Two suggestions...

1) Could it be that your code is not working because of carriage
returns, i.e. this code
> 				<xsl:when test="_Ctrl">
> 					<xsl:value-of select="'1'"/>
> 				</xsl:when>
sets your variable to the value '
		1
'
and so it is not string-equal to '1'?

You could avoid this problem by taking Michael Kay's suggestion
about using a boolean variable; or by using number(),
or strip-space().


2) You said your xml inside <Rpt_Inven> varies all the time;
but does the location of _Ctrl vary?  If not, you could
get rid of the variable and do
						<xsl:if test="/lay:data/_Ctrl">
instead of
						<xsl:if test="$CtrlExists='1'">


HTH,
Lars


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



Current Thread
Keywords
xml