473,406 Members | 2,217 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,406 software developers and data experts.

sax and special entities

A javabean that uses sax is having trouble importing
an xml file that has   in the fields.

Is there anyway to configure sax to interpret this as a
special entity reference?
Jul 20 '05 #1
1 1495
> A javabean that uses sax is having trouble importing
an xml file that has   in the fields.


Nothing wrong with your parser... the XML that contains a reference to an
entity other than one of the predefined ones (amp, lt, gt, quot, apos) must
reference a DTD containing a declaration of that entity. (DTDs are checked
for entity declarations and attribute value defaults even if the parser is
not validating.)

First ensure that the nbsp entity is declared. For example, this will always
work:

<!DOCTYPE foo [ <!ENTITY nbsp " "> ]>

....and this will work if your XML parser is configured to read external DTDs
(they have the option not to read any external files at all):

<!DOCTYPE foo SYSTEM "xhtml-lat1.ent">

If you go with the latter example, get xhtml-lat1.ent from
http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent and put it in the same
directory as the XML; don't refer to the w3.org copy directly. See the XHTML
spec for references to the other .ent files for all the HTML/XHTML entities.
Jul 20 '05 #2

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

Similar topics

6
by: John van Terheijden | last post by:
Hi. I'm trying to develop a program that uses XML files store data. I'm using Windows XP, Apache 1.3.29 and PHP 4.3.4. Right now the XML file is read using the xml_parser_create(),...
6
by: Horst Gutmann | last post by:
Hi :-) I currently have quite a big problem with minidom and special chars (for example &uuml;) in HTML. Let's say I have following input file:...
50
by: The Bicycling Guitarist | last post by:
A browser conforming to HTML 4.0 is required to recognize &#number; notations. If I use XHTML 1.0 and charset UTF-8 though, does &eacute; have as much support as é ? Sometimes when I run...
3
by: Gibs | last post by:
Hi Is there any way to show the special symbols in a TextBox. Thanks in Advance Gibs
25
by: Wim Cossement | last post by:
Hello, I was wondering if there are a few good pages and/or examples on how to process form data correctly for putting it in a MySQL DB. Since I'm not used to using PHP a lot, I already found...
0
by: Trac Bannon | last post by:
I am using VS 2003. I have an XML file that is generated by Oracle. The file is UTF8 encoded. In my code, I am creating an XMLDataDocument. To load the XMLDataDocument I create a TextReader...
7
by: Trac Bannon | last post by:
When I load XML from a file into a dotNet XMLDataDocument, the UTF-8 codes are resolved but the 5 special XML entities are not. How can I force those 5 special character types to be translated?
10
by: Aray | last post by:
<!ENTITY % testEntity "(test)"> <!ELEMENT testElement %testEntity;> Above is a valid DTD file. But it doesn't work when I try to put a charater '/' in to the Content of testEntity. like...
2
by: Diilb | last post by:
I am using DOM to create an rss feed. The problem I am running into is "special characters" such as é è ç. If I try adding them to the XML as character data (CData), DOM chokes and throws out...
4
by: Dan Andrews | last post by:
Hello, I was wondering what is the correct way to handle special characters via javascript and the DOM. I would like to avoid document.write and innerHTML. What I am doing is dynamically...
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: 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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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,...

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.