|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
generation of non-ascii characters, xhtml - htmlHi,
Using this simple example: <?xml version='1.0' encoding='ISO-8859-1' ?> <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"> <rich:panel> <h:outputText value="h& # 2 4 6 ; j " /> <h:outputText value="höj" /> </rich:panel> </f:view> I wish to output the swedish character "ö" which should be the result of using "& # 2 4 6 ;" (i inserted spaces since it would render as "ö" otherwise). The problem is that in the response both "& # 2 4 6 ;" and "ö" results in "& o u m l ;" which is the html entity. This works perfectly in firefox and IE but not in Chrome or Safari where the error message is " Entity 'ouml' not defined". I'm not blaming Chrome or Safari here since my xhtml should not contain html entities. Is it possible to make my facelets return the "& # 2 4 6" style of the characters? And is this really a facelet issue? Some additional info is that i'm using org.springframework.web.jsf.el.SpringBeanFacesELResolver as el-resolver if that matters. I'm starting to get a bit frustrated here so any help is highly appreciated! /Patrik |
|
|
RE: generation of non-ascii characters, xhtml - htmlMy understanding is that both of the examples below are equivalent, because the ö is substituted by the XML parser that reads the facelet file before any facelet or JSF code even sees it. I would suggest trying ö (although I have a nagging doubt that there is a problem with that). You will also need to set the escape attribute on the outputText component to false.
-----Original Message----- From: putteb [mailto:patrik44@...] Sent: Sun 9/6/2009 12:09 PM To: users@... Subject: generation of non-ascii characters, xhtml - html Hi, Using this simple example: <?xml version='1.0' encoding='ISO-8859-1' ?> <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"> <rich:panel> <h:outputText value="h& # 2 4 6 ; j " /> <h:outputText value="höj" /> </rich:panel> </f:view> I wish to output the swedish character "ö" which should be the result of using "& # 2 4 6 ;" (i inserted spaces since it would render as "ö" otherwise). The problem is that in the response both "& # 2 4 6 ;" and "ö" results in "& o u m l ;" which is the html entity. This works perfectly in firefox and IE but not in Chrome or Safari where the error message is " Entity 'ouml' not defined". I'm not blaming Chrome or Safari here since my xhtml should not contain html entities. Is it possible to make my facelets return the "& # 2 4 6" style of the characters? And is this really a facelet issue? Some additional info is that i'm using org.springframework.web.jsf.el.SpringBeanFacesELResolver as el-resolver if that matters. I'm starting to get a bit frustrated here so any help is highly appreciated! /Patrik -- View this message in context: http://www.nabble.com/generation-of-non-ascii-characters%2C-xhtml---html-tp25319115p25319115.html Sent from the java.net - facelets users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: generation of non-ascii characters, xhtml - htmlThanks for your reply. Yes, the two examples are equivalent, I just provided two examples. And yes it works when i escape the characters so that would be a possible workaround. The page source then shows the "ö" character so it's equivalent to writing "ö" in my markup with escape="false". But is there no way i can generate the "& # 2 4 6 ;" style without changing all my markup?
/Patrik
|
|
|
RE: generation of non-ascii characters, xhtml - htmlDeclaring this DOCTYPE solves the problem with Chrome:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > Then Chrome handles the "& ouml;". |
| Free embeddable forum powered by Nabble | Forum Help |