You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ramin Raybod <r_...@isc.iranet.net> on 2002/04/21 05:42:35 UTC

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

Re: entity declaration

Posted by Scott Vachalek <sc...@Integrisoft.COM>.
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 ----- 
  From: Ramin Raybod 
  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