Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 11th, 2007, 02:06 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default 2-byte UTF-8 sequence during XML2XML conversion

Hi All,

I got following Error message for particular files during the XML2XML conversion. I not sure my file is error free specifically in (Unicode's), also file is does't have any encoding specification in XML name space.

File:
 <?xml version="1.0"?>
<document>
<title/>
<section>
.....
</section>
</document>

Error Message:
================================================== ========================
com.sun.org.apache.xerces.internal.impl.io.Malform edByteSequenceException: Invalid byte 2
  of 2-byte UTF-8 sequence.
Transformation failed: Run-time errors were reported
================================================== ========================

Any help would be appreciated.

ROCXY


__________________
Thanks,
Rocxy.
 
Old July 11th, 2007, 05:44 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Most likely your file was never intended to be in UTF-8 in the first place, so you just need to find out what its actual encoding is, and add that to the XML declaration.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 11th, 2007, 07:57 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Dear Kay,

This file encoded with Unicode and the above statement results the same error as shown above.

File:
<?xml version="1.0" encoding="UTF-8" ?>


ROCXY



 
Old July 11th, 2007, 09:40 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If the Xerces parser says it's invalid Unicode, then trust me, it's invalid Unicode.

Find out how the file was created and fix it.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
encoding="UTF-8" Pankaj C XSLT 3 October 4th, 2007 05:27 PM
Byte alignment or byte padding subodh_chettri C++ Programming 0 June 23rd, 2006 10:35 AM
UTF-8 sebastian Classic ASP Basics 0 March 16th, 2005 08:22 AM
UTF-8 msxml lpinho XML 4 January 28th, 2004 06:10 AM
UTF-16 dkb XML 14 November 7th, 2003 09:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.