<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Tahoma size=2><SPAN
class=118082014-09092004>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma size=2><SPAN
class=118082014-09092004></SPAN></FONT> </DIV>
<DIV><FONT face=Tahoma size=2><SPAN class=118082014-09092004>I wonder how one
adds an entity to a document type, I want s</SPAN></FONT><FONT face=Tahoma
size=2><SPAN class=118082014-09092004>omething like this :</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma size=2><SPAN
class=118082014-09092004></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=118082014-09092004><FONT face=Tahoma><FONT color=#800000
size=2><!DOCTYPE blabla SYSTEM "first.DTD" <FONT
color=#008000>[<!ENTITY % extension SYSTEM "second.dtd"> %extension;
]</FONT></FONT></FONT></FONT><FONT face=Tahoma color=#800000
size=2>></FONT></SPAN></DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma size=2>I didn't find any
method in DocType who could do the job, so </FONT></SPAN><SPAN
class=118082014-09092004><FONT face=Tahoma size=2>I assumed
<EM>Document.addContent(Content content)</EM> (the class EntityRef extends
Content) would be the thing to use :</FONT></SPAN></DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma color=#808080
size=2>Document doc = new Document(documentRoot);</FONT></SPAN></DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma color=#808080
size=2>DocType docType = new DocType( elementName, systemID );
</FONT></SPAN></DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma color=#808080
size=2>doc.setDocType(docType);</FONT></SPAN></DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma color=#808080
size=2>EntityRef entityRef = new EntityRef( elementName, systemID
);<BR><FONT color=#ff0000>doc.addContent(entityRef ); // throws
exception</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma size=2>but it didn't work,
I got : "An EntityRef is not allowed at the document root".</FONT></SPAN></DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=118082014-09092004><FONT face=Tahoma size=2>So .. how do I
accomplish this ? (I hope this isn't a stupid question)</FONT></SPAN></DIV><FONT
face=Verdana size=1><STRONG>
<P>Verheyen Quinten</FONT></STRONG><FONT size=2>
<DIV></FONT><FONT face=Verdana size=1>Software Engineer</FONT><FONT
size=2></DIV>
<DIV></FONT><FONT face=Verdana size=1>Rue Gabrielle Petitstraat
4/6</FONT><BR></DIV>
<DIV><FONT face=Verdana size=1>1080 Brussel</FONT><BR></DIV>
<DIV><FONT face=Verdana size=1>Tel : +0032 (0)2 502 85 00</FONT><BR></DIV>
<DIV><FONT face=Verdana size=1>Fax : +0032 (0)2 502 76 07<BR>Gsm : +0032 (0)494
81 04 81</FONT><BR></DIV>
<DIV><FONT face=Verdana size=1>E-mail : </FONT><A
href="mailto:q.verheyen@ringring.be"><FONT face=Verdana
size=1>q.verheyen@ringring.be</FONT></A><BR><BR><I><FONT size=1><FONT
size=5><FONT size=1><FONT face=Verdana size=1>"The process of intelligent
conduct is essentially a process of selection from among various alternatives;
intelligence is largely a matter of selectivity. Delayed reaction is
necessary to intelligent contact." - Mead
G.H.</FONT></FONT></FONT></DIV></I></FONT>
<DIV> </DIV></BODY></HTML>