AW: [jdom-interest] Special characters in XML?

Falk Fraikin fraikin at
Fri Mar 16 03:02:02 PST 2001

Hi Gary,

I'm not so sure what you mean when you write "built in", but XMLOutputter
converts the following charcters to their corresponding entity reference (as
specified by XML 1.0):

 '<' = "&lt;";
 '>' = "&gt;";
 '\'' = "&apos;";
 '\"' = "&quot;";
 '&' = "&amp;";

I hope that this is, what you asked for.


Falk Fraikin

-----Ursprüngliche Nachricht-----
Von: jdom-interest-admin at
[mailto:jdom-interest-admin at]Im Auftrag von Gary Bentley
Gesendet: Freitag, 16. März 2001 11:15
An: jdom-interest at
Betreff: RE: [jdom-interest] Special characters in XML?

As a point of interest, JDOM seems to have a number of entities built in,
does anyone have a complete list?  I know that &lt; is built in for obvious


-----Original Message-----
From: jdom-interest-admin at
[mailto:jdom-interest-admin at]On Behalf Of
philip.nelson at
Sent: Friday, March 16, 2001 4:44 AM
To: jdom-interest at
Subject: RE: [jdom-interest] Special characters in XML?

 &reg is an entity and you have to declare these entities before they are
used.  *maybe* you confusing this entity with a similar idea in html where
certain entities are predeclared.  Look into doctypes and you'll have your

-----Original Message-----
From: David M. Goudreau
To: JDOM-Interest
Sent: 3/15/01 7:53 PM
Subject: [jdom-interest] Special characters in XML?

I'm trying to store special characters such as . (the registered
symbol) in my XML string and I'm having difficulties.  It is updated
JDOM and stored in my database just fine using JDOM, but when it tries
instantiate the document object from the string I get the following

org.jdom.JDOMException: Error on line 2: The entity "reg" was
but not declared.

The XML that causes the problem is:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE root><root
sub_id="84"><folder name="tester" cdate="3/15/01" id="f_272" /><folder
name="&reg;" cdate="3/15/01" id="f_273" /></root>

Is there an easy way to handle special characters?  I would think this
conversion would be automatic depending on the encoding you use.  Do I
to use a different encoding?  What's the best way to handle special
characters?  Or do I need to create a DTD to define the "reg" entity?
Thanks in advance.


To control your jdom-interest membership:
To control your jdom-interest membership:

To control your jdom-interest membership:

More information about the jdom-interest mailing list