473,466 Members | 4,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SAXparseException from Clipboard text

Hi,

I have a program that is being used on Mac's and PC's. The Mac's are running
OSX. The user can copy and paste text from the clipboard into a JTextArea
which is part of a form. Sometimes when the text comes from the clipboard
there is a hollow box at the end. This box cannot be selected. I am using
the DecodeXML and EncodeXML methods to save files to disk until the user
decides to save the files to a database. When these files are written or
read from disk I receive this error:

'org.xml.sax.SAXParseException: Illegal XML character: �.'

Does anyone have a clue as to what � translates to? What is this that is
coming from the clipboard. This is text that is being copied from one
application to a java textfield all on a Mac. This is not persistent, it
only occurs occasionally and really screws things up when it does.

If this is return or control characters could anyone point me to some
literature on how to filter this stuff out in java.

Thanks for any help,
Rich

Jul 17 '05 #1
2 3435
Rich Sweeny wrote:
Hi,

I have a program that is being used on Mac's and PC's. The Mac's are running
OSX. The user can copy and paste text from the clipboard into a JTextArea
which is part of a form. Sometimes when the text comes from the clipboard
there is a hollow box at the end. This box cannot be selected. I am using
the DecodeXML and EncodeXML methods to save files to disk until the user
decides to save the files to a database. When these files are written or
read from disk I receive this error:

'org.xml.sax.SAXParseException: Illegal XML character: �.'

Does anyone have a clue as to what � translates to? What is this that is
coming from the clipboard. This is text that is being copied from one
application to a java textfield all on a Mac. This is not persistent, it
only occurs occasionally and really screws things up when it does.

If this is return or control characters could anyone point me to some
literature on how to filter this stuff out in java.


The � is your XML creator's way of trying to encode the character
represented by the number 0. Unfortunately, you cannot use this
encoding scheme to encode characters with numeric values less than some
number (I think 20, check the XML specification at w3c.org if you need
the exact number).

So it appears that whatever code is creating the XML is broken.

HTH,
Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #2
On 3/16/05 7:02 AM, in article Ye*******************@twister.nyroc.rr.com,
"Raymond DeCampo" <no****@twcny.rr.com> wrote:
Rich Sweeny wrote:
Hi,

I have a program that is being used on Mac's and PC's. The Mac's are running
OSX. The user can copy and paste text from the clipboard into a JTextArea
which is part of a form. Sometimes when the text comes from the clipboard
there is a hollow box at the end. This box cannot be selected. I am using
the DecodeXML and EncodeXML methods to save files to disk until the user
decides to save the files to a database. When these files are written or
read from disk I receive this error:

'org.xml.sax.SAXParseException: Illegal XML character: &#x0;.'

Does anyone have a clue as to what &#x0; translates to? What is this that is
coming from the clipboard. This is text that is being copied from one
application to a java textfield all on a Mac. This is not persistent, it
only occurs occasionally and really screws things up when it does.

If this is return or control characters could anyone point me to some
literature on how to filter this stuff out in java.


The &#x0; is your XML creator's way of trying to encode the character
represented by the number 0. Unfortunately, you cannot use this
encoding scheme to encode characters with numeric values less than some
number (I think 20, check the XML specification at w3c.org if you need
the exact number).

So it appears that whatever code is creating the XML is broken.

HTH,
Ray


Would it use this if it does not know what something is. I should have been
clearer on the methods I am using to read and write the xml. I am using the
classes that come with the API.

import java.beans.XMLDecoder;
import java.beans.XMLEncoder;

Thanks

Jul 17 '05 #3

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

Similar topics

0
by: xyz | last post by:
I have a menu item to handle clipboard actions (cut, copy, paste). When I paste text that I copied from a Hungarian web page, the display looks normal on my RichTextBox, but the text retrieved from...
8
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a...
2
by: Gey-Hong Gweon | last post by:
Is there a way to copy a PIL image to windows clipboard (as a dib image or a bitmap, I suppose)? What I would like to accomplish is to do a fast copy and paste of images from my python...
2
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with...
16
by: ad | last post by:
Hi, How can we get the content of clipboard with program?
7
by: Newbie | last post by:
How do I clear the clipboard in VB.NET 2003? TIA Newbie
1
by: Figmo | last post by:
Wow.....this is darned odd.... I have an app that integrates with other applications. It registers a global hotkey with Windows. When the hotkey executes it sends a CTRL-C to the active...
8
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the...
20
by: Joe Duchtel | last post by:
Hello - I have the following code to get a bitmap from the clipboard and to save it to a *.png file ... Dim lData As IDataObject = Clipboard.GetDataObject() If...
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:
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.