473,383 Members | 1,733 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,383 software developers and data experts.

XMLParser error with unicode characters in XML file.

I am getting a XML parsing error from weblogic.apache.xerces when I parse a XML
document which contains accented characters.
This is what I am doing

1) Some database columns have accented data for spanish,japanese etc languages
like Número de identificação: and número de identificación.

2) I am reading this data and creating a XML file using some processing and
then writing the file on the disc using weblogic.xml.stream.XMLOutputStream
flush() method.

3) Then I am using FOP to render this XML in PDF. In the rendering process
the weblogic.apache.xerces.XMLparser gets called to parse the XML. Here the
parser throws a org.xml.sax.SAXParserException ( An invalid XML character
(Unicode: 0xfa) was found in the element content of the document).
I was under the impression that XMLParser should take care of the accented
characters. When I open the XML file which I created in XML SPY I see "box"
characters like "cliente n? de identificaci��".

Please let me know how should i handle my code here.

Thanks
Jul 20 '05 #1
1 4063
In article <92*************************@posting.google.com> ,
Manoj Nair <de*******@yahoo.com> wrote:

% I am getting a XML parsing error from weblogic.apache.xerces when I parse a XML
% document which contains accented characters.

An example might be good. The problem is most likely that you're not
specifying an encoding, and that your data is not encoded in utf-8.

Try including an XML declaration:

<?xml version='1.0' encoding='iso-8859-1'?>

at the start of your XML files. This ought to work for the spanish data.
You'll need to find out how the japanese data is encoded and either
put that encoding in the XML declaration, or convert the data to UTF-8.

--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #2

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

Similar topics

6
by: ..... | last post by:
I have an established program that I am changing to allow users to select one of eight languages and have all the label captions change accordingly. I have no problems with English, French, Dutch,...
23
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner,...
8
by: Eric Lilja | last post by:
Hello, I had what I thought was normal text-file and I needed to locate a string matching a certain pattern in that file and, if found, replace that string. I thought this would be simple but I had...
7
by: Michael Davis | last post by:
Hi, I've known C/C++ for years, but only ever used ascii strings. I have a client who wants to know how gcc handles unicode. I've found the functions utf8_mbtowc, utf8_mbstowcs, utf8_wctomb and...
3
by: john | last post by:
I need to produce a RTF-document which is filled with data from a database. I've created a RTF-document in WordPad (a template, so to speak) which contains 'placeholders', for example '<dd01>',...
4
by: ½ðÖÇΰ | last post by:
Hi£¬you guys, I'm a newbee in VS .Net I installed a VS .Net 2003 Chinese Professional in my Chinese WinXP PC. When compiling any cpp file, I got chaos codes in my output window, such as: ...
18
by: Ger | last post by:
I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found...
6
by: Jeff | last post by:
Hi - I'm setting up a streamreader in a VB.NET app to read a text file and display its contents in a multiline textbox. If I set it up with System.Text.Encoding.Unicode, it reads a unicode...
1
by: Alexander Higgins | last post by:
>>Thanks for the response.... Point Taken but this is not the case. Thus, if a person writes a text file on her or his computer and does not use UNICODE to save it, the current code page is...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.