Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with trying to match string with single quote 1

Status
Not open for further replies.

miraclemaker

Programmer
Oct 16, 2002
127
GB
Hi guys. I'm havin serious problems trying to match and XML node using XSL based on he value of an attribute when the attribute value has a single quote in it. Here's an example:

XML:
Code:
<gameGroup priority="5" title="Kids' Favorites">

XSL:
Code:
<xsl:template match="gameGroup[@title='Kids' Favorites']">

- the single quote in the value of attribute 'title' is causing me real problems. I've read there's no way to escape a string in XPath, but this problem must have come up before. Does anyone have a solution?

Many thanks.
 
You could use:
Code:
<xsl:template match='gameGroup[@title="Kids&apos; Favorites"]'>

Jon

"Asteroids do not concern me, Admiral. I want that ship, not excuses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top