[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

How to search for <, >, etc. in a string?

Subject: How to search for <, >, etc. in a string?
From: Brian Young <Brian.Young@xxxxxxx>
Date: Tue, 26 Sep 2000 14:46:58 -0400
How to search for <
Hello,

I was hoping you all could shed some light on a pretty basic issue I'm facing.  It's probably one of those "Sure, here's the answer!" or "No, no way" types.

I have XML that contains some CDATA:

<string>
	<![CDATA[<u>Link containing a & character</u>]]>
</string>

I'd like to strip out the <u> and </u>, but only if they exist in the CDATA.  To that end, I've used the string functions.  An example of this is:

<xsl:when test="starts-with($linkTextUnStripped, '<u>')">
	<xsl:value-of select="substring($linkTextUnStripped, 4)" />
</xsl:when>

The problem is the use of '<' and '>' in the second parameter of the starts-with function.  I tried replacing them with &lt; and &gt; but I believe that it is then literally looking for '&' followed by 'l' by 't' by ';' and soforth.

Is there a way to specify <, >, ", etc. in such cases?

Thank you for your time,
   Brian Young


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.