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]
Other format: [Raw text]

Re: question about xsl:if


u cant use predicate with '.'

besides..if u explain what the statement
<xsl:if test=".[.!text()='TONY']"> intends to mean, it wud be gr8

also. please go through a standard XSLT book ( XSLT Programmer's reference or any XSLT book)
before you start coding..
vasu

From: Alia Mikati <Aliam@investcomholding.com>
Reply-To: xsl-list@lists.mulberrytech.com
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] question about xsl:if
Date: Thu, 29 Aug 2002 10:29:47 +0300

Hi all,
I have the foolowing xml and xsl files:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="testing.xsl"?>
<html>
	<body>
		<table>
			<tr>
				<td>
					<font color="#800080">Balance
1:</font>
				</td>
				<td>
					<input type="text"
name="balance1" size="20" value="200$"/>
				</td>
			</tr>
		</table>
		<table>
			<tr>
				<td>
					<font color="#800080">Balance
2:</font>
				</td>
				<td>
					<input type="text"
name="balance2" size="20" value="500$"/>
				</td>
			</tr>
			<tr>
				<td>
					Tony
				</td>
				<td>
					10000
				</td>
			</tr>
		</table>
	</body>
</html>

and the xsl file is:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">

<xsl:template match="/">
<html>
 <body>
  <p align="center">
   <b><font size="5">Welcome to Book Store</font></b>
  </p>
  <xsl:apply-templates select="/html" />
 </body>
</html>
</xsl:template>

<xsl:template match="/html">
  <xsl:apply-templates select="body/table/tr/td" />
</xsl:template>

<xsl:template match="body/table/tr/td">
  <xsl:if test=".[.!text()='TONY']">
	alia
  </xsl:if>
  <xsl:apply-templates select="input" />
</xsl:template>


<xsl:template match="input">
    <xsl:if test="@name='balance2'">
	    <b> Balance value is : <xsl:value-of select="@value" />
</b><br/>
    </xsl:if>
</xsl:template>

</xsl:stylesheet>

Can u plz tell me y am i getting this msg ???
Expected token 'eof' found '['. .-->[<--.!text()='TONY']

Thx a lot



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



_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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]