Subject: Re: contains() function to search general in xslt
From: Arulraj <p_arulraj@xxxxxxxxx>
Date: Mon, 5 Dec 2005 11:46:02 +0000 (GMT)
|
Hi,
I have the following XML fragment as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Layout>
<param name="Refreshable" value="false"/>
<Box name="header1">
<control name="header1contrls"/>
</Box>
<Box name="Application" position="absolute">
<control name="Applicationcontrls"/>
</Box>
</Layout>
I am using the XSLT to find the child elements of
Layout using contains like the following.
<xsl:template match="/">
<xsl:for-each select="Layout">
<xsl:if
test="contains(child::Box/@name,'Application')">
<xsl:text>Box with Application is avaialble
</xsl:text>
</xsl:if>
<xsl:if test="not(contains(child::Box/@name,
'Application'))">
<xsl:text>Box with Application is not avaialble
</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
Using the above code,
I got the output Box with Application is not
available.. Can tell me the reason? why it is not
checking the Box with a name 'Application'..
Regards,
Raj
__________________________________________________________
Enjoy this Diwali with Y! India Click here http://in.promos.yahoo.com/fabmall/index.html
|