[jdom-interest] adding EntityRef to Document throws Exception
Quinten Verheyen
q.verheyen at ringring.be
Thu Sep 9 07:32:50 PDT 2004
Hi,
I wonder how one adds an entity to a document type, I want something like this :
<!DOCTYPE blabla SYSTEM "first.DTD" [<!ENTITY % extension SYSTEM "second.dtd"> %extension; ]>
I didn't find any method in DocType who could do the job, so I assumed Document.addContent(Content content) (the class EntityRef extends Content) would be the thing to use :
Document doc = new Document(documentRoot);
DocType docType = new DocType( elementName, systemID );
doc.setDocType(docType);
EntityRef entityRef = new EntityRef( elementName, systemID );
doc.addContent(entityRef ); // throws exception
but it didn't work, I got : "An EntityRef is not allowed at the document root".
So .. how do I accomplish this ? (I hope this isn't a stupid question)
Verheyen Quinten
Software Engineer
Rue Gabrielle Petitstraat 4/6
1080 Brussel
Tel : +0032 (0)2 502 85 00
Fax : +0032 (0)2 502 76 07
Gsm : +0032 (0)494 81 04 81
E-mail : <mailto:q.verheyen at ringring.be> q.verheyen at ringring.be
"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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://servlets.com/pipermail/jdom-interest/attachments/20040909/6dee3c65/attachment.htm
More information about the jdom-interest
mailing list