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

Re: general string replace?

Subject: Re: general string replace?
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 24 May 2001 18:00:00 -0600 (MDT)
xsl string replace
Chris Nolte wrote:
> I am having some trouble using Jeni Tennison's general
> string replace template that is described in the FAQ:
> http://www.dpawson.co.uk/xsl/stringreplace.html
> 
> Specifically, when using XT I get the error message
> "character not allowed."  When using Xalan, I get the
> more helpful message: 
> XSLT Error
> (javax.xml.transform.TransformerConfigurationException):
> The value of attribute "test" must not contain the '<'
> character.
> 
> It is referring to this line in the replace_strings
> template:
> 
> <xsl:when test="$search < count(document
> ('')//foo:search)">


When he put the sample code in the FAQ, it looks like Dave Pawson remembered
to change "<" and ">" to "&lt;" and "&gt;", but he forgot to change "&" to
"&amp;" so that it would render properly in the browser.

  <xsl:when test="$search &lt; count(document('')//foo:search)">

is what you want.

Also note there are 2 parts of the FAQ that cover pretty much the same 
topic.

http://www.dpawson.co.uk/xsl/replace.html
and
http://www.dpawson.co.uk/xsl/stringreplace.html



   - Mike
_____________________________________________________________________________
mike j. brown, software engineer at  |  xml/xslt: http://skew.org/xml/
webb.net in denver, colorado, USA    |  personal: http://hyperreal.org/~mike/

 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.