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

Re: Standalone documents as external parsed entities.

  • From: "James Tauber" <jtauber@j...>
  • To: <xml-dev@i...>
  • Date: Tue, 13 Apr 1999 00:29:19 +0800

external parsed entity
> >From my reading of the XML 1.0 spec, it is not possible to have a
> standalone document, with it's own DTD, "included" in another document
> as an external parsed entity.
>
> Am I wrong?

There are ways around it. But for starters, be careful with the term
"standalone" as it means something quite specific in XML (and something
different from what I'm guessing you mean by it).

If you don't care about the DTD, then you can have:

list.xml:

<?xml version="1.0"?>
<!DOCTYPE list [
    <!ENTITY doc1 SYSTEM "doc1.xml">
    <!ENTITY doc2 SYSTEM "doc2.xml">
]>
<list>
    &doc1;
    &doc2;
</list>

doc1.xml:

<!-- note null prolog (except for this) -->
<doc>...</doc>

doc2.xml:

<!-- note null prolog (except for this) -->
<doc>...</doc>


In this case doc1.xml and doc2.xml can be treated both as external parsed
entities and as document entities.

If you *do* what the individual external entities to have a DTD, you'll have
to use a wrapper document.

list.xml:

<?xml version="1.0"?>
<!DOCTYPE list SYSTEM "list.dtd" [
    <!ENTITY doc1.content SYSTEM "doc1content.xml">
    <!ENTITY doc2.content SYSTEM "doc2content.xml">
]>
<list>
    <doc>&doc1.content;</doc>
    <doc>&doc2.content;</doc>
</list>

doc1.xml:

<?xml version="1.0"?>
<!DOCTYPE doc SYSTEM "doc.dtd" [
    <!ENTITY doc.content SYSTEM "doc1content.xml">
]>
<doc>&doc.content;</doc>

doc2.xml:

<?xml version="1.0"?>
<!DOCTYPE doc SYSTEM "doc.dtd" [
    <!ENTITY doc.content SYSTEM "doc2content.xml">
]>
<doc>&doc.content;</doc>

doc1content.xml:

<!-- null prolog -->
<!-- content of doc1 -->

doc2content.xml:

<!-- null prolog -->
<!-- content of doc2 -->



Note that because you can't put the document element in an external parsed
entity, it is included in the doc wrappers and in the list.

Hope this helps.

James
--
James Tauber / jtauber@j... / www.jtauber.com
XML Standards and Product Coordinator
HarvestRoad Communications / www.harvestroad.com.au

Full-day XML Tutorial @ WWW8 : http://www8.org/

Maintainer of : www.xmlinfo.com,  www.xmlsoftware.com and www.schema.net



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 (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe 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.