You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Siddharth <si...@cbk.com> on 2003/08/28 06:45:26 UTC

Unicode support in JSTL xml tags

Hi,

I am trying to parse a xml file with a non-english Unicode content using jstl's xml tag. But I get the error, "Content not allowed in Prolog". I tried to parse the same xml with other parsers like msxml, jaxp and it works fine. I can even print the textual form of the xml using <c:out>. Where am I going wrong? Is there something I should do before parsing Unicode xml files? 

This is the sample xml file, test.xml :

<?xml version="1.0" encoding="UTF-8"?>
<root>
	வேர்
</root>

and the JSTL code was,

<c:import url="test.xml" var="xfile"/>
<x:parse xml="${xfile}" var="xdoc"/>
<x:out select="$xdoc/root"/>


Thanx for the attention.

Siddharth.


Re: Unicode support in JSTL xml tags

Posted by Jason Lea <ja...@kumachan.net.nz>.
Hi Siddharth,

You might have to specify the charEncoding for the <c:import> because it 
might be defaulting to ISO-8859-1.

Try this:

<c:import url="test.xml" var="xfile" charEncoding="UTF-8" />



Siddharth wrote:

> Hi,
> 
> I am trying to parse a xml file with a non-english Unicode content using jstl's xml tag. But I get the error, "Content not allowed in Prolog". I tried to parse the same xml with other parsers like msxml, jaxp and it works fine. I can even print the textual form of the xml using <c:out>. Where am I going wrong? Is there something I should do before parsing Unicode xml files? 
> 
> This is the sample xml file, test.xml :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <root>
> 	வேர்
> </root>
> 
> and the JSTL code was,
> 
> <c:import url="test.xml" var="xfile"/>
> <x:parse xml="${xfile}" var="xdoc"/>
> <x:out select="$xdoc/root"/>
> 
> 
> Thanx for the attention.
> 
> Siddharth.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> 
> 


-- 
Jason Lea