[jdom-interest] basic xml/jdom questions...

Alex Rosen arosen at novell.com
Mon Jul 21 07:44:51 PDT 2003


But if the document starts with an XML declaration <?xml ... ?> then
you'll have to put the DOCTYPE declaration after this. Fortunately the
XML declaration can contain only US-ASCII characters, although they may
be in any encoding. IIRC, basically every encoding except UTF-16 and
EBCDIC are identical to US-ASCII encoding for US-ASCII characters, so as
long as you don't care about EBCDIC, all you need to handle is UTF-16
and US-ASCII. (Don't forget to handle the byte-order mark.)

I'm sure someone somewhere has already written this code...

Alex


>>> "New, Cecil (GEAE)" <cecil.new at ae.ge.com> 7/21/2003 10:30:15 AM
>>>
if the incoming documents don't have a DOCTYPE and you know what you
want it
to be, then:
a. read file into memory as a string
b. prepend your doctype
c. then parse the new string of XML




More information about the jdom-interest mailing list