This might be a better question for a general XML forum, not Xerces, but I believe the answer is: yes and no.  Yes, you need a DTD to declare the entity, and no, it does not need to be a full DTD.
 
Another approach is to use XSLT.  This is my preferred approach, since I prefer XML schema to DTDs.  Then rather than
 
&myentity;
 
you write
 
<myentity/>
 
and create a rule in the XSLT to convert that to whatever you like.  It's actually a lot more powerful since you can pass parameters, get context information, etc.
 
--Scott
 
----- Original Message -----
To: xerces
Sent: Saturday, April 20, 2002 8:42 PM
Subject: entity declaration

Hi,
I'm an xml amateur reader. I have a problem.
If I want to have an entity in a document,is it really need to define a DTD for it including the doc elements structure? Suppose u have a large doc and full of complex elements and u r not required to use a DTD for it but you want to have a recurring entity. Is it possible not to define the whole dtd and have just your favorite entity :)
thanx
Ramin

Reply via email to