struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: utf-8 characters and xslt result type
Date Fri, 23 May 2014 11:16:11 GMT
necesita %C3%A8

por ejemplo
Hell%C3%Ao World

http://www.w3schools.com/tags/ref_urlencode.asp

Saludos Cordiales desde EEUU

Martín  
______________________________________________ 



> Date: Thu, 22 May 2014 22:54:45 -0700
> Subject: utf-8 characters and xslt result type
> From: arflobow@gmail.com
> To: user@struts.apache.org
> 
> I have the following in my struts.xml
> 
> <action name="testutf8" class="TestXml">
>   <result name="success" type="xslt">
>     <param name="exposedValue">utf8</param>
>     <param name="location">testxml.xsl</param>
>   </result>
> </action>
> 
> My testxml.xsl file looks like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="xml" />
> <xsl:template match="result">
> <xsl:copy-of select="." />
> </xsl:template>
> </xsl:stylesheet>
> 
> My TestXML.java file looks has the following
> public Class TestXml {
>   private String utf8="hèllo world"; // a string with utf-8 character,
> getters+setters omitted here
> 
>   public String execute throws Exception {
>     return "success";
>   }
> }
> 
> When I request /testutf8 I get the following in the browser:
> XML Parsing Error: not well-formed
> Location: http://localhost:8080/testutf8
> Line Number 1, Column 48:<?xml version="1.0"
> encoding="UTF-8"?><result>h￿llo world</result>
> -----------------------------------------------^
> 
> It seems the utf-8 character is not being handled properly.  How can I make
> the xslt result type handle the utf-8 character correctly?
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message