Guest bradley Posted September 17, 2008 Share Posted September 17, 2008 Help!If I have a series of data, for example, "abcde......", "bcdefg......", "ghijkle...", "cdoeognd...", etc, I want to display the results only with the data that have the letter strings of "cd", how can I put it in XSLT?I'm a newcomer of XSLT. Please give me a hand! Thanks. Link to comment Share on other sites More sharing options...
aalbetski Posted September 17, 2008 Share Posted September 17, 2008 something like this? <xsl:for-each select="data"> <xsl:value-of select="contains(text(),'cd')"/></xsl:for-each> Link to comment Share on other sites More sharing options...
boen_robot Posted September 17, 2008 Share Posted September 17, 2008 Use the contains() function over the node you're trying to match. For example: <xsl:for-each select="//*[contains(.,'cd')]"><xsl:value-of select="." /></xsl:for-each> Will print out the text of all elements (regardless of their name) that contain the string "cd" in them. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.