473,388 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

ERROR when using xalan

hi,
i have already used xalan several times with success, but i have a error
message that i don't understand, thanks for your help

(Emplacement inconnu de l'erreur) Erreur XSLT
(javax.xml.transform.TransformerConfigurationExcep tion):
javax.xml.transform.TransformerException: java.io.UTFData
FormatException: Invalid byte 2 of 3-byte UTF-8 sequence.

thanks
Jul 20 '05 #1
1 7228
"Bekkali Hicham" <hi************@wanadoo.fr> wrote in message news:bd**********@news-reader3.wanadoo.fr...
i have already used xalan several times with success, but i have a error
message that i don't understand : : javax.xml.transform.TransformerException: java.io.UTFData
FormatException: Invalid byte 2 of 3-byte UTF-8 sequence.


This looks like a Java I/O exception that Xalan is just passing along. UTF-8
is an encoding that sometimes refers to multi-byte character sequences (MBCS).
If I recall correctly when the first-byte is 0x80-0x9f (and there's another span of
values in addition to this span) then it's the lead byte of a multi-byte sequence
representing one Unicode character. This allows many commonly occuring
characters to be encoded with one byte while some less frequent chars are
encoded with multiple bytes.

The error message, "Invalid byte 2 of 3-byte UTF-8 sequence" means that
a Java I/O streaming object expected, from the first byte, that this was a 3
byte sequence and when it examined the second byte, it determined that the
second byte was an illegal value (for instance, a value contradicting the first
byte).

What does this mean for you, the programmer?

Two possibilities:

1. There is no encoding attribute in the document's XML declaration, and
Xalan is assuming it is UTF-8 when the document is not UTF-8.
2. The document may have been UTF-8 and was corrupted in transmission
(was it sent over the network?)

If there is no encoding attribute in the document's XML declaration, put one
there. For example, if there are Traditional Chinese (Taiwanese) characters
in the XML document, you might try:

<?xml version="1.0" encoding="Big5" ?>

if they are Simplified Chinese, then try GB2312, if it's Japanese, try JIS.
etc. When Xalan reads one of these encodings, I think Xerces will transcode
them to Unicode, or at least use a non-UTF8 streaming source.

If one or more bytes of the document were corrupted, you may be able to
simply edit the document and look for any glyphs that look out-of-place
at the point in the document where the error occured.
HTH,

Derek Harmon
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: al dav | last post by:
Hi all ok i am not a java programmer I am a sys-admin, my users want xalan and have already got j2sdk_1.4.2 so i have downloaded it and set the CLASS_PATH export...
1
by: Hyunchan Kim | last post by:
To indent xml file, I made an instance of Transformer from Templates using following. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
7
by: Ganesh Gella | last post by:
Hi All, I am planning to use Xalan to transform XML data by applying xls stylesheets. Here tricky part is, Xalan provides several C++ APIs, which are very much useful if our requirement is...
0
by: Xiaolei Li | last post by:
first off, i'm a total newbie at this stuff so excuse any wrong usage of terminology or whatever else. i have a XSL to transform a Document such that all "text" nodes will have a "SPAN" inserted...
2
by: Dr. Roger Wießner | last post by:
Hello! I am a newbie to XSLT and need a freeware/GNU Tool to get experience with this new topic. Which one is a good XSLT? Xalan or Saxon, or which one else? Thank you a lot!
2
by: henribastien | last post by:
I'm trying to return an array from a xalan extension but so far I have made no progress. What I would like to return is something like that <entry id="red">201</entry> <entry...
3
by: moralbarometer | last post by:
Please i intend to make an XML document from a string using tranformer as shown below. It returns an error which trace is given below as well. please help. public org.w3c.dom.Node getTextXML()...
2
by: lanegroups | last post by:
Dear experts, I'm trying to do the following using Xalan-C++ API 1. parse an XML document 2. evaluate an XML path 3. serialize the selected XML subtree 4. The new serialized XML fragment should...
1
by: redcic | last post by:
Hi, Does anyone know which version of Java Virtual Machine I need to run Xalan 2.7.0. I've got difficulties with Java 1.1.8. Thanks, Cédric
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.