|
Subject: RE: Matching attributes that contain both &pos; and " From: Kay Michael <Michael.Kay@xxxxxxx> Date: Fri, 8 Sep 2000 11:41:02 +0100 |
> However the following example proves troublesome for XT, Saxon
> and Xalan. All of them generate an error.
> <xsl:template match="channel/location[@name=' "x" '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('"x"', "'a" z)]">
The trick is to write the XPath expression "naturally", and then replace all
occurrences of " with " 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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: Matching attributes that contai, Kaganovich, Yevgeniy | Thread | RE: Matching attributes that contai, Paul_Dick |
| RE: XSLT and Text Processing Langua, Kay Michael | Date | Re: Formatting output as Java sourc, Tom Mullen |
| Month |