Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > ERROR when using xalan

Reply
Thread Tools

ERROR when using xalan

 
 
Bekkali Hicham
Guest
Posts: n/a
 
      06-24-2003
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


 
Reply With Quote
 
 
 
 
Derek Harmon
Guest
Posts: n/a
 
      06-25-2003
"Bekkali Hicham" <> wrote in message news:bdafo9$or8$...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error while setting parameter using -p option in xalan dodo_ind XML 0 02-10-2009 09:11 AM
XML Xalan error on linux Guntius.GIBLI@gmail.com Java 1 09-27-2006 09:02 AM
[xalan] FATAL ERROR: could not compile stylesheet z-man Java 5 04-14-2006 09:43 AM
ERRor using jboss 4.0 and xercers, xalan ,xslt, to get xml satish mn via JavaKB.com Java 0 11-25-2004 03:14 PM
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57