Thread: [Xsltforms-support] XForm fail in IE6 fails with comments with I18N characters (and XPath handling
Brought to you by:
alain-couthures
From: Kostis A. <ank...@gm...> - 2010-04-07 19:18:56
Attachments:
commentsWithI18N.xml
xpathWithI18N.xml
|
2 problems: 1) A xform with comments containing non-ASCII UTF-8 characters (greek for instance) prevents the xform from compiling in IE6 (currently cannot try ie 7 & 8). 2) In another similar issue in IE (6 & 7, 8 not tested), i found problems when XPath handles text containing non-ASCII chars, resulting into html-escaped-entities presented into the user. I can work-arround these issues by avoiding placing I18N text directly into XPath expressions, and entering them into instance-doc nodes instead. Both problems reported against rev383, IE6 (not tested with IE 7 & 8) I apologize for not attempting to investigate when this issue was firstly introduced. The next 2 xforms, demonstrate both problems. (Note that they contain greek characters, so they must be copied verbatim from the mail text or use the attached ones) file: commentsWithI18N.xml -------------------- <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" encoding="UTF-8" type="text/xsl"?> <html lang="el" xml:lang="el" xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.w3.org/2002/xforms http://www.w3.org/MarkUp/Forms/2007/XForms-11-Schema.xsd http://www.w3.org/2001/xml-events http://www.w3.org/MarkUp/SCHEMA/xml-events-attribs-1.xsd " > <head> <title>Comments with I18N</title> <xf:model id="model-main" > <xf:instance id="inst-doc" > <doc> <text> Some Text </text> </doc> </xf:instance> </xf:model> </head> <body> <!-- WARN: Due to the next comment, form fails on IE6. Not tested on ie 7 & 8. --> <!-- Καλημέρα! --> <xf:output value="text" /> </body> </html> file: xpathWithI18N.xml ----------------------------------- <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" encoding="UTF-8" type="text/xsl"?> <html lang="el" xml:lang="el" xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.w3.org/2002/xforms http://www.w3.org/MarkUp/Forms/2007/XForms-11-Schema.xsd http://www.w3.org/2001/xml-events http://www.w3.org/MarkUp/SCHEMA/xml-events-attribs-1.xsd " > <head> <title>XPath with I18N</title> <xf:model> <xf:instance> <root> <text>is non-translatable!</text> </root> </xf:instance> </xf:model> </head> <body> <xf:output value="concat('Φιλότιμο ', /root/text)" > <xf:label>The next I18N text fails(showing html-entities) on IE6: </xf:label> </xf:output> <xf:trigger> <xf:label>xf:setvalue with I18n msg fails also in IE6!</xf:label> <xf:setvalue ev:event="DOMActivate" ref="/root/text">δεν μεταφράζεται!</xf:setvalue> </xf:trigger> </body> </html> Regards, Kostis |
From: Kostis A. <ank...@gm...> - 2010-04-12 15:41:32
|
2010/4/7 Kostis Anagnostopoulos <ank...@gm...>: > 2 problems: > > [...] > > 2) In another similar issue in IE (6 & 7, 8 not tested), > i found problems when XPath handles text containing non-ASCII chars, > resulting into html-escaped-entities presented into the user. > > I can work-arround these issues by avoiding placing I18N text directly > into XPath expressions, > and entering them into instance-doc nodes instead. > > > Both problems reported against rev383, IE6 (not tested with IE 7 & 8) > I apologize for not attempting to investigate when this issue was > firstly introduced. Hi, I traced the problem to I18N handling problems to the fact that the content of the file 'xsltforms.xsl' and xsltforms.js are both ISO-8859-1, and the xsl:output@encoding="ISO-8859-1" xslt declaration. Is there any reason why these files are not in UTF-8 encoding? Thansk in Advance, Kostis Is the |
From: COUTHURES A. <ala...@ag...> - 2010-04-12 19:17:59
|
Hi,: > I traced the problem to I18N handling problems to the fact that the > content of the file 'xsltforms.xsl' and xsltforms.js are both > ISO-8859-1, > and the xsl:output@encoding="ISO-8859-1" xslt declaration. > > Is there any reason why these files are not in UTF-8 encoding? > xsltforms.xsl been with ISO-8859-1 shouldn't disturb because it doesn't contain characters not been in ISO-8859-1. xsltforms.js isn't explicitly with ISO-8859-1 encoding... A BOM might force UTF encoding but, as xsltforms.xsl, it doesn't contain characters not been in ISO-8859-1 either... xsl:output@encoding should, in the contrary, be very sensible to non-ISO-8859-1! Can you please test with xsl:output@encoding="UTF-8" ? BTW, can you send me a config_gr.xsl file? I already have UTF-8 config files which are operational, at least when processed by the Javascript part. Thanks! -Alain |
From: COUTHURES A. <ala...@ag...> - 2010-04-18 21:19:33
|
Hi Kostis, > I atteched the gr file you asked, but i note that the language is 'el'. > The 'gr' refers to the country, similar to en_UK, etc. > So the file name should be "config_el.xsl". Can you please check that it works for you? > Regarding the encodings, i had problems with IE particularly,not with > FF or chrome. > When on ISO-8859-1 encoding, and the message-text passes through > either xsl or through js, > IE fails to print greek messages correctly, i see their html entities instead For output, there is a specific approach to be used with IE in this case: use of .innerHTML to convert entities. It appears that output/@encoding has to stay at "iso-8859-1" in this case. Using output/@encoding="utf-8" is OK for UTF-8 comments but not for Javascript instructions. There might be a fix for that too but I preferred removing all comments in the XForms source. Is it a problem for you? This is committed. Thanks! -Alain |
From: Kostis A. <ank...@gm...> - 2010-04-19 11:16:51
|
On Mon, Apr 19, 2010 at 12:20 AM, COUTHURES Alain <ala...@ag...> wrote: > Hi Kostis, >> >> I atteched the gr file you asked, but i note that the language is 'el'. >> The 'gr' refers to the country, similar to en_UK, etc. >> > > So the file name should be "config_el.xsl". Can you please check that it > works for you? Hi Alain, I cannot switch to *any* language. I tried adding the follosing PI: <?xsltforms-options debug="yes" lang="el"?> but it did not work. Am i missing something here? Regards, Kostis |