cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Benéteau <m.benet...@quaternove.fr>
Subject Different behaviours of HTMLSerializer, in attributes and elements.
Date Mon, 18 Mar 2002 09:51:38 GMT
Hi,

I have a little problem with the HTMLSerializer and accented letters in
French.
I'm working with Cocoon 2.0.1.
All my XML files and stylesheets and all my components use the iso-8859-1
encoding.


In my XML file I have the following element, which has an &eacute; letter in
attribute "nom" :

<dimensionPhysique nom='puissance réelle' indexDimension='9'/>


This element is correctly processed by a stylesheet to give the following
XHTML :

<a name="puissance réelle"></a>
<table>
  <tr>
    <td bgcolor="#EEDDEE">
      <b>Dimension name :</b>
      puissance réelle
      <br/>
      <b>Dimension index :</b>
      9
    </td>
  </tr>
  ...
</table>

So now the accented letter appears twice : once in the "name" attribute of
an anchor, and once in the content of a table row. No problem here.


The problem appears after serialization with the HTMLSerializer, which gives
the following HTML :

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
...
<a name="puissance r%C3%A9elle"></a>
<table>
  <tr>
    <td bgcolor="#EEDDEE">
      <b>Dimension name : </b>
      puissance r&eacute;elle
      <br/>
      <b>Dimension index : </b>
      9
    </td>
  </tr>
  ...
</table>

In the "name" atribute of the anchor, the &eacute; letter has been replaced
by %C3%A9, so the following instruction will fail :
parent.centerFrame.location.hash='#puissance r&eacute;elle';


IMHO, this is not a correct behaviour of the HTMLSerializer.
Am I right ?


Matthieu




---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message