Dominique Quatravaux wrote:
Hello,

Ciao Dominique


I worked around this problem, but I well think that it should considered a serious bug in XPathScript;


Well, I am the co-maintainer of XML::XPathScript and I have an
objection :-) Would you please retry your failing stylesheet and the
original AxKit code (sans Matt's patch) after putting the following at
the beginning of your XML file?

<?xml version="1.0" encoding="iso-8859-1"?>

No need to do it: it was there already. Before and after Matt's patch: it doesn't work.. This is the page:


<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="templ.xps" type="application/x-xpathscript"?>
<page>Questa � una pagina</page>

and this is the stylesheet (templ.xps):

<html>
<% $t->{page}{pre} = '<h1>' ;
   $t->{page}{post} = '</h1>' ;

#   $r->content_type("text/html; charset=ISO-8859-1") ;
   %><head>
  <title>This page has no title</title>
</head>
<body><%= apply_templates() %></body>
</html>


but page content is ISO-8859-1 actually:

<html>

<head><title>This page has no title</title></head>
<body><h1>Questa ? una pagina</h1></body>

^ | This is not ISO apparently (or is it a copy-paste glitch?) I'd rather interpret the question mark as the symptom of some UTF-8 state machine failing to interpret stuff. Indeed, "� " is not a valid UTF-8 string.

That "?" is what Mozilla showed up. In short: - the page was ISO-8859-1 encoded - Apache reported a UTF-8 encoding - mozilla recognized "�" as an invalid UTF-8 string and put a "?" in its place

Moreover, the same weird behaviour of UTF-8-encoding text nodes inside variables but leaving them unchanged otherwhise happens also using the xpathscript utility. If I run

xpathscript temp.xps templ.xps

the "�" is there, while if I run it against this other stylesheet

<html>
<% my $page = findvalue('/page/text()') ; %>
<head><title><%= $page %></title></head>
<body><h1><%= $page %></h1></body>
</html>

the "�" is UTF-8 encoded.

* first of all, note that all my XML docs are ISO-8859-1 encoded;


That's okay, as long as they are marked as such

they are


In the current state of the AxKit CVS, XML::XPathScript does not share
code with AxKit, although the factoring work is done already and
available at http://kilimandjaro.dyndns.org/XPathScript/, but not yet
integrated (also search for "YPathScript" in the list archive).

Sorry, I badly explained my question. I asked that because the bug occurs on both Apache::AxKit::Language::XPathScript and XML::XPathScript


Still, the method you use in order to produce ISO output should be
documented for the ISO-only (e.g., non-Web) usages of
XPathScript. This is already on my �urgent - to be done later� list
:-).

:-)


Ciao
--M

--
Marco Marongiu                            Email: [EMAIL PROTECTED]
System Administrator                      Phone: +39 070 460 1684
Tiscali S.p.A.                            Fax:   +39 070 460 9684
International IT Services


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to