Re: WG: [xslt] decimal char problem - possible Solution



On Thu, Sep 13, 2001 at 05:22:21PM +0200, Morus Walter wrote:
> The problem shows up, when you require an encoding like ISO-8859-1.
> In utf-8 output there is no need to introduce a character reference,
> so libxml doesn't.
[...]
> So for people, who want to have iso-latin1 HTML (e.g. to avoid problems
> with opera (or does it handle unicode now?) or for whatever reason they
> have) and avoid hexadecimal character references (e.g. due to netscape
> issues), there is a problem. 

  Morus,

 thanks for your explanation, you were the first to provide me the
complete explanation of the problem :-)

 I decided to implement the solution initially proposed by Marco except
without the conditional global variable:
  - in encoding.c, in the fallback case, output the charref using the
    decimal notation, there is not enough context at that point to try to
    make any smart choice.
  - in entities.c, we have far more context, and I simply checked whether
    the document is an HTML one, in that case generate the decimal version
    otherwise the hexadecimal one as before.

 The impact is minimal, in the XML test suite a single case output is changed
and in the XSLT suite only the DocBook (x)html regression tests are changed
which correspond actually to the behaviour asked for (assuming I really
fully understood the issue).

 I suggest people try the enclosed patch and complain if those break something,
the output are *theorically* equivalent, but unfortunately in the HTML world
nobody seems to care much about that level ...
 Now, if one browser appears to not digest decimal character references there
are no generic solution :-(

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]