[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: error in DTD with multiple entities

  • From: Marcus Carr <mrc@a...>
  • To: Wendi Sisson <wsisson@e...>
  • Date: Sun, 12 Aug 2001 14:14:28 +1000

dtd entity

Wendi Sisson wrote:

> I have one DTD that references 2 other DTDs by using entities. The 2
> other DTDs are from 3rd party sources and I am not at liberty to change
> them. Both the referenced DTDs have an element named "country" and so I
> get errors from the parser when I try to parse an XML document that
> uses my DTD.

I would replace the element declaration in each DTD with identically named parameter entities for country.
(Technically, this isn't changing the DTD any more than tidying up line breaks would be - each DTD run by itself
would behave exactly the same way that it currently does.) Then define the contents of the parameter entity in the
internal subset of each document depending on the name of the doctype element.

You would then end up with the same wrapper DTD that you had, and something like this in the first included DTD:

   <!ENTITY % Country  "<!ELEMENT Country  (Foo)>">

and something like this in the second included DTD:

   <!ENTITY % Country  "<!ELEMENT Country  (Bar)>">

Your instances would then either start with:

   <!DOCTYPE tx1Root SYSTEM "wrapper.dtd"  [
   <!ENTITY % Country  "<!ELEMENT Country  (Foo)>">
   %Country;
   ]>

or with:

   <!DOCTYPE tx2Root SYSTEM "wrapper.dtd"  [
   <!ENTITY % Country  "<!ELEMENT Country  (Bar)>">
   %Country;
   ]>

Your processor may or may not warn you about the multiple declarations for the Country parameter entity, but it
should process correctly. The only limitation is that if you try to run either DTD in isolation, you will have to
provide the parameter entity and the reference in the internal subset. I think that's the closest you can get to "not
changing the DTDs".


--
Regards,

Marcus Carr                      email:  mrc@a...
___________________________________________________________________
Allette Systems (Australia)      www:    http://www.allette.com.au
___________________________________________________________________
"Everything should be made as simple as possible, but not simpler."
       - Einstein



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.