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

Re: Referencing multiple DTD in an XML document

  • From: David Brownell <david-b@p...>
  • To: mparul@i...
  • Date: Tue, 02 Nov 1999 11:09:16 -0800

xml multiple dtd
mparul@i... wrote:
> 
> Is it possible to reference two DTD files in the DOCTYPE declaration in an
> XML document?

Absolutely -- just use the right syntax.


First, keep in mind that there are only "external parameter entities".
Too many people talk as if the external subset, as in

	<!DOCTYPE foo SYSTEM "http://www.example.com/uri">

is the DTD ... instead, the whole <!DOCTYPE ...> is the DTD, which
is just a set of declarations.  Don't think of a "DTD file", since
DTDs can consist of many files.


Second, keep in mind that the external subset is only syntactic
sugar, and you can do the same thing without an external subset:

	<!DOCTYPE foo [
	<!ENTITY % foo SYSTEM "http://www.example.com/uri">
	%foo;
	]>

That DTD is semantically equivalent to the first one I showed.


> If not, then how can one use both MathML and say SpeechML tags in an XML
> document.

I presume you want the answer even if you _can reference more than
one external parameter entity?  :-)

It's a simple extension of what I showed above:

	<!DOCTYPE foo [
	<!ENTITY % MathML SYSTEM "http://www.example.com/MathML.dtd">
	%MathML;
	<!ENTITY % SpeechML SYSTEM "http://www.example.com/SpeechML.dtd">
	%SpeechML;
	]>

I'd encourage you to use PUBLIC identifiers as well, so that
local cached copies of those declarations can easily be used.

As has been pointed out, actually combining two DTDs can be a
problem if they happen to use the same element or entity names
for different purposes.  DTD syntax was designed to allow you
to combine sets of declarations designed for that purpose, but
if they weren't so designed ... trouble.  Namespace-aware schemas
may provide solutions in that space, at some point.

- Dave

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



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.