[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Matching attributes that contain both &pos; and "
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|