xsl-list
[Top] [All Lists]

Re: Apostrophe escaping in contains().

2003-12-02 12:15:20
Ben,

You're escaping the apostrophe correctly, but once the parser is done with it, it is passing the expression

contains($text, '"'"')

to be interpreted as XPath. That's where you're hitting the error.

The usual workaround (FAQ alert) is to bind the character to a variable and use a variable reference.

...and in your other thread, why are you using disable-output-escaping?

Cheers,
Wendell

At 12:08 PM 12/2/2003, you wrote:
I'm trying to get a test using contains() to look for an apostrophe. My XSLT processor (Saxon) keeps telling me that I need whitespace between attributes.

        The fragment I'm working with looks like this:

<xsl:when test="contains($text, '"&apos;"')> some stuff </xsl:when>

I've searched the FAQs, and they report that I'm escaping the apostrophe correctly.


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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