[Home] [By Thread] [By Date] [Recent Entries]
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.) 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>
|

Cart



