Jump to content

Please give me a hand!


Guest bradley

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...