<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.8">
</HEAD>
<BODY>
Great stuff Alex. It is exactly what I needed (can't wait for 1.0b10 as it has some really powerfull stuff).<BR>
<BR>
Best regards<BR>
<BR>
Ben<BR>
<BR>
On Thu, 2003-10-16 at 15:14, Alex Rosen wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373"><I>If I remember correctly JDOM now (in the current CVS tree, not in beta
9) will automatically escape any characters that the output encoding
can't handle. So if you just tell it to output in US-ASCII, it'll turn
all chars > 127 into entities.
(Note that there were some API changes after beta 9 so you'll have to
do a little work to use the latest code.)
Alex
>>> Benjamin Kopic <benjamin.kopic@panContext.com> 10/16/2003 4:37:39
AM >>>
Hi
I need to write some sort of Entity handling routine that converts all
of the non US-ASCII characters
to their SGML Entity reference. There was some discussion on this
subject way back, but I am not sure
what came out of it. All of the documents I need to produce have to
comply to the following restriction:</FONT>
<A HREF="http://www.ncbi.nlm.nih.gov/entrez/query/static/entities.html"><U>http://www.ncbi.nlm.nih.gov/entrez/query/static/entities.html</U></A>
<FONT COLOR="#737373">
What would be the best way:
a) write EntityRef for each one of these and then let JDOM
XMLOutputter
do the conversion (I assume it
does it)
b) write my own String conversion utility that converts the chars
outside 127 bit range to their entity
ref value.
Actually, what I really would like to know is if JDOM would convert a
Unicode String to an XML String
that is valid for a particular encoding (i.e. US-ASCII) simply by
registering EntityRef for each of
the characters outside the range for the given encoding?
Best regards
Benjamin</I></FONT></PRE>
</BLOCKQUOTE>
<PRE><TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>--
benjamin kopic
m: +44 (0)780 154 7643
t: +44 (0)20 7794 3090
e: benjamin.kopic@panContext.com
w: http://www.panContext.com/</PRE>
</TD>
</TR>
</TABLE>
</PRE>
</BODY>
</HTML>