[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
At 2006-04-23 02:27 +0200, rolf@xxxxxxxxxxxx wrote:
Correct ... but literal operands can be constructed easily enough.
(copied and modified below)
How about the following?
I hope this helps.
. . . . . . Ken
</xsl:stylesheet>
Re: [xsl] Can't have both " and ' in an XPath literal
Subject: Re: [xsl] Can't have both " and ' in an XPath literal From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 22 Apr 2006 21:18:00 -0400 |
At 2006-04-23 02:27 +0200, rolf@xxxxxxxxxxxx wrote:
As far as I see, there is no way to have both ' (') and " (") in one XPath literal.
Correct ... but literal operands can be constructed easily enough.
Example:
(copied and modified below)
But as far as I see, there is no way in XPath 1.0 to write a predicate, which selects such values, because it is not possible to write an XPath literal which includes both of the possible delimiter characters of an XPath literal. (A similar example could be easily constructed for text content of an element.)
To all of my knowledge, the XPath 1.0 syntax has no escaping mechanism for literal delimiters at all.
Do I miss something?
How about the following?
I hope this helps.
. . . . . . Ken
T:\ftemp>type rolf.xml <doc> <e att="foo">foo</e> <e att="a'"b">bar</e> <e att="grill">grill</e> </doc>
T:\ftemp>type rolf.xsl <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="doc"> <xsl:for-each select="e[@att=concat("a'",'"b')]"> <xsl:value-of select="."/> </xsl:for-each> </xsl:template>
</xsl:stylesheet>
T:\ftemp>xslt rolf.xml rolf.xsl con <?xml version="1.0" encoding="utf-8"?>bar T:\ftemp>
-- Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16 Also for XSLT/XSL-FO training: Minneapolis, MN 2006-07-31/08-04 Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25 Also for XSLT/XSL-FO training: Copenhagen,Denmark 2006-05-08/11 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Can't have both " and &a, rolf | Thread | Re: [xsl] Can't have both " an, rolf |
[xsl] Can't have both " and &a, rolf | Date | Re: [xsl] Can't have both " an, rolf |
Month |
Keywords