This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
RE: [docbook] Future DocBook Ruminations - Modular Source Files & XInclude
- From: Elliotte Rusty Harold <elharo at metalab dot unc dot edu>
- To: "Wills, Robert" <Robert dot Wills at sts dot co dot uk>, docbook at lists dot oasis-open dot org
- Date: Thu, 21 Aug 2003 06:45:37 -0400
- Subject: RE: [docbook] Future DocBook Ruminations - Modular Source Files & XInclude
- References: <B0B3EF6EA2E66F4F80D39E793B4095EC0FE0FE@wm2kswi560.sts.co.uk>
At 5:20 PM +0100 8/20/03, Wills, Robert wrote:
<?oodb-include href="intro.xml"?>
... with ...
<include xmlns="http://www.w3.org/2001/XInclude" href="intro.xml"/>
... which seems the "correct" approach, the validating editors I have tried
immediately complain about the unrecognised <include> element.
You need to declare that element (and redefine a couple of entities)
in the internal DTD subset like this:
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"docbook/docbookx.dtd" [
<!-- add XIncludes -->
<!ENTITY % local.para.char.mix " | xinclude:include">
<!ELEMENT xinclude:include EMPTY>
<!ATTLIST xinclude:include
xmlns:xinclude CDATA #FIXED "http://www.w3.org/2001/XInclude"
href CDATA #REQUIRED
parse (text | xml) "xml"
>
]>
Depending on exactly where you put the include elements you may need
to adjust which parameter entity references you override. This
example works when you never include inline elements, only block
level elements and higher. And of course you may have to change the
namespace prefix to suit. But this is essentially how it's done.
--
Elliotte Rusty Harold
elharo@metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-help@lists.oasis-open.org