Re: Standalone documents as external parsed entities.
> >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!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format