Re: [xsl] using xsl:output-character to render characters in 2 ways

Subject: Re: [xsl] using xsl:output-character to render characters in 2 ways
From: Tom T <tomw289@xxxxxxxxxxxxxx>
Date: Fri, 13 Nov 2009 15:40:42 +0000
>  but the implied question was how come the system isn't just doing the
> necessary quoting for you, you must be suppressing its usual
> serialisation somewhere and writing attribute syntax "by hand"?

The processor I am using (Saxon 9) is converting the following string:

Financial Times, "ErdoDan" diyor.

to the following:

<meta name="description" content='Financial Times, &#34;ErdoDan&#34;
diyor.'>

So the attribute value is what I expect. The problem is that the
double quotes we usually use on attributes are now being rendered as
single quotes. Any idea why?




On Thu, Nov 12, 2009 at 12:59 PM, David Carlisle <davidc@xxxxxxxxx> wrote:
>
>
>> Is it wrong to escape characters such as this in when its not an
>> attribute value? It will involve more work to cancel out the escaping.
>
> no or yes, depending.
>
> If you have a ' in a comment or cdata section or processing instruction
> B and quote it for example it is wrong because the xml parser won't
> B unquote it.
>
> <p> it's</p>
>
> is the same as
>
> <p> it&#39;s</p>
>
> but
>
> <?xml-stylesheet href='foo.xsl'?>
>
> isn't the same as
>
>
> <?xml-stylesheet href=&#39;foo.xsl&#39;?>
>
>
> B but the implied question was how come the system isn't just doing the
> necessary quoting for you, you must be suppressing its usual
> serialisation somewhere and writing attribute syntax "by hand"?
>
>> If my way is as good as any, the only way I can get this to work is by
>> declaring the single-quote entity in a Doctype declaration for every
>> stylesheet its used in:
>
> given that it's easier and less keystrokes to type &#xE503; as
> &single-quote; why bother with the entity at all, and just use B &#xE503;
> It makes no difference to the XSLT processor, it won't see either
> &single-quote; or &#xE503; both are expanded by teh xml parser before it
> starts to look at the xslt code.
>
> David
>
> ________________________________________________________________________
> The Numerical Algorithms Group Ltd is a company registered in England
> and Wales with company number 1249803. The registered office is:
> Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
>
> This e-mail has been scanned for all viruses by Star. The service is
> powered by MessageLabs.
> ________________________________________________________________________

Current Thread