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

RE: Matching attributes that contain both &pos; and "

Subject: RE: Matching attributes that contain both &pos; and "
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Fri, 8 Sep 2000 11:41:02 +0100
xpath delimiter
> However the following example proves troublesome for XT, Saxon
> and Xalan. All of them generate an error.

> <xsl:template match="channel/location[@name=' "x" &apos;a z']">

It is an error, because it's not well-formed XML. 

> 
> This might be a flaw with the spec,

It's not really a flaw in the spec: this would be a valid XPath expression,
it's just that you can't use it at this place in a well-formed XML document.

>  but given that it isn't, does anyone
> have a work around for how to match this attribute.

Given that variables ca't be used in a template match pattern, I think the
only way around it is with concat().

<xsl:template match="channel/location[
          @name=concat('&quot;x&quot;', &quot'a&quot z)]">

The trick is to write the XPath expression "naturally", and then replace all
occurrences of " with &quot; regardless whether it's being used as an XPath
string delimiter or as a character within a string. 

Mike Kay


 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.