[xslt] string literal with single-quote inside won't parse
- From: Viktor Štujber <theultramage gmail com>
- To: The Gnome XSLT library mailing-list <xslt gnome org>
- Subject: [xslt] string literal with single-quote inside won't parse
- Date: Fri, 11 Sep 2009 21:22:12 +0200
Hello. I noticed that libxslt errors out if I try to use a
single-quoted string literal with a single-qoute (') or ' inside
it. I know it can be worked around using a temporary variable to store
the literal, however I'm curious whether this issue will be resolved
someday, or whether it is 'a feature'.
For reference, the xpath document on the w3c site says in its
introduction, "To avoid a quotation mark in an expression being
interpreted by the XML processor as terminating the attribute value
the quotation mark can be entered as a character
reference (" or ')".
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" />
<xsl:template match="/">
<xsl:value-of select="'Hello, I'm a literal with an apostrophe inside.'"/>
</xsl:template>
<!--
http://www.w3.org/TR/xpath
To avoid a quotation mark in an expression being interpreted by the XML processor
as terminating the attribute value the quotation mark can be entered as a character
reference (" or ').
-->
<!--
libxslt 1.1.24
XPath error : Invalid expression
'Hello, I'm a literal with an apostrophe inside.'
^
compilation error: file x.xsl line 6 element value-of
xsl:value-of : could not compile select expression ''Hello, I'm a literal with an apostrophe inside.''
-->
</xsl:stylesheet>
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]