Subject: Re: [xsl] How to create a literal string attribute value that contains an apostrophe? From: Marc <Marc.Liste@xxxxxxx> Date: Mon, 09 Dec 2013 16:07:02 +0100 |
Hi Folks,
I want to output a string.
This
<xsl:value-of select="'he is good'" />
outputs:
he is good
Now, suppose that I want to output:
he's good
This
<xsl:value-of select="'he's good'" />
produces an error. Apparently the entity is resolved to yield
<xsl:value-of select="'he's good'" />
and that is obviously an error.
So what's the solution?
Answer: escape the ampersand in the apostrophe entity reference:
<xsl:value-of select="'he&apos;s good'" />
Now that doesn't seem reasonable. It means that there is double entity resolution occurring: the first to convert
&apos;
to '
and the second to convert
'
to
'
Where is this double entity resolution occurring? The XML parser does the first entity resolution. What is doing the second entity resolution?
/Roger
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to create a literal s, Imsieke, Gerrit, le- | Thread | [xsl] Announcement - XslDocMaker fo, Kevin Brown |
Re: [xsl] How to create a literal s, David Carlisle | Date | [xsl] Announcement - XslDocMaker fo, Kevin Brown |
Month |