xsl-list
[Top] [All Lists]

Re: contains() function to search general in xslt

2005-12-05 04:46:02
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--