xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Cates" <cat...@home.com>
Subject Unicode problem
Date Tue, 01 May 2001 00:37:22 GMT
I am working on a project that is using the German language.  All our xml is
supposed to be headed with iso-8859-1.  Some data was recently loaded to the
database, and I am suddenly getting the following exception:

SystemId Unknown; Line 292; Column 24; ; Line#: 292; Column#: 24
javax.xml.transform.TransformerException: An invalid XML character (Unicode:
0x1e) was found in the element content of the document.
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
660)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1118)


Where the code looks like:
public void process(Source xml, Source xsl, Writer out){
        try{

             TransformerFactory tFactory;
             Transformer serializer;

                         tFactory = TransformerFactory.newInstance();

            serializer = tFactory.newTransformer(xsl);
            serializer.setOutputProperty(OutputKeys.ENCODING,"iso-8859-1");
            serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
"yes");
            serializer.transform(xml ,new StreamResult(out));
        }catch(Exception ex){
            ex.printStackTrace();

....

Is there something I have missed here.  If the doc doesn't have the
encoding="iso-8859-1" should this matter if I explictly set it?  I am using
v2 of xalan/xerces.  Any help is appreciated.

Thanks
Jon


Mime
View raw message