Hello,

we are facing some embarrassing requirement here. We must provide an xml file to another service. We developped the database extraction using a simple Facelets template.You just had to dowload the page, it's already in xml with correct tag. Inside xml element are the value. Like <firstname>Mégane</firstname>. However, facelets being very smart, make this output: <firstname>M&#233;gane</firstname>. From an xml poin of view it's still valid, and for us it's ok. On the other side of the line is that other service with what looks like a home brewed xml parser. This one doesn't understand xmlentities and just put them like that in database, leading to curious result in interface. They asked us to not use those entities. However, we don't want to fully disable escaping by replacing in template
<firstname>#{person.firstname}</firstname>
by
<firstname><h:outputText value="#{person.firstname}" escape="false"/></firstname>

because this is
1) more difficult to read
2) risky for elements where a '>' or a '>' could popup (don't underestimate user's capability to use those where least expected)

So is there some way to tell JSF or Facelets to only escape risky characters like > < ? I assume our friends speaking japanese/corean/russian/arabic have a way to keep their generated xhtml files from being full of entities.

Reply via email to