[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Hi Raj,
If you read up on contains, this function requires a value and a substring.
If value is not a string, it is converted to one, using the rules for string conversion.
child::Box/@name (which can be written much shorter as simply Box/@name - as the child axis is the default axis), returns a nodeset containing all the found name attributes. The string conversion rule explicitly states that it takes the string-value of the first node in document order. The first Box/@name you encounter has a string value of "header1", which is not what you are testing for.
You should be able to do something like:
So in your for-each, apply templates on Box elements, and have a template for each of your conditions.
I hope this helps.
Re: [xsl] contains() function to search general in xslt
Subject: Re: [xsl] contains() function to search general in xslt From: "Ragulf Pickaxe" <ragulf.pickaxe@xxxxxxxxxxx> Date: Mon, 05 Dec 2005 13:09:08 +0100 |
Hi Raj,
<xsl:if test="contains(child::Box/@name,'Application')"> <xsl:text>Box with Application is avaialble </xsl:text>
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'..
If you read up on contains, this function requires a value and a substring.
If value is not a string, it is converted to one, using the rules for string conversion.
child::Box/@name (which can be written much shorter as simply Box/@name - as the child axis is the default axis), returns a nodeset containing all the found name attributes. The string conversion rule explicitly states that it takes the string-value of the first node in document order. The first Box/@name you encounter has a string value of "header1", which is not what you are testing for.
You should be able to do something like:
<xsl:template match="Box[contains(@name,'Application')]"> <xsl:text>Box with Application is avaialble</xsl:text> </xsl:template>
So in your for-each, apply templates on Box elements, and have a template for each of your conditions.
I hope this helps.
Regards, Ragulf Pickaxe :-)
_________________________________________________________________ Undge pop-ups med MSN Toolbar - http://toolbar.msn.dk/ hent den gratis!
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] contains() function to se, Arulraj | Thread | Re: [xsl] contains() function to se, David Carlisle |
Re: [xsl] XSLT Processing w/ Embedd, drkm | Date | Re: [xsl] R: [xsl] IQuestion about , drkm |
Month |