|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: contains() function to search general in xslt
Hi Raj,
<xsl:if test="contains(child::Box/@name,'Application')"> <xsl:text>Box with Application is avaialble </xsl:text> 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!
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








