This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: XInclude doesn't validate with xmllint


In the environment I'm using, that won't validate. Though I'm not saying
it's wrong!

However this works for me:

<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"docbookx.dtd" [

    <!-- add XIncludes -->
  <!ENTITY % local.para.char.mix " | xinclude:include">
  <!ELEMENT xinclude:include EMPTY>
  <!ATTLIST xinclude:include
     href           CDATA #REQUIRED
     parse          (text | xml) "xml"
   >
  <!ATTLIST chapter
   xmlns:xinclude CDATA #FIXED "http://www.w3.org/2001/XInclude";
 >
]>

<chapter xmlns:xinclude='http://www.w3.org/2001/XInclude'>
 <title>Chapter Title</title>
 <para><xinclude:include href="" />Paragraph Text</para>
</chapter>

It's interesting that one can use XInclude without any changes being made to
the docbook dtd.

However I'm still not comfortable with using XInclude because of the
possible problems that might occur when including documents which have their
own document type declaration.

A previous post mentioned what happens when the included document has
graphic entity or other entity declarations whose names conflict with those
in the including document, or when IDs conflict (as I understand it these
problems are reported as fatal errors, though I believe a smart XInclude
processor could probably handle them).  But what happens if the included
document has an internal document type declaration that redefines the
content models of elements, or when the included document is using DocBook
v4.1.2 and the including document is using DocBook v4.2 ?!  These latter
problems cannot occur with External Entity references.

nik

----- Original Message -----
From: "Elliotte Rusty Harold" <elharo@metalab.unc.edu>
To: <docbook-apps@lists.oasis-open.org>
Sent: 06 December 2002 11:58
Subject: Re: DOCBOOK-APPS: XInclude doesn't validate with xmllint


> It would be helpful to remember that it is possible today to write
> DocBook documents that are completely valid before and after
> XInclusions, without any modifications to the core DocBook DTD. You
> just need to add an internal subset to you documents that adds
> xinclude:include to the content models of those elements where you've
> chosen to place an XInclude element. For example, the chapter
> documents for Processing XML with Java
> <http://www.ibiblio.org/xml/books/xmljava/> all begin like this:
>
> <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.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"
>   >
> ]>
>
> Authors who use XIncludes in different places may need to change
> different parameter entities. However, I'm pretty sure the technique
> is broadly applicable.
> --
>
> +-----------------------+------------------------+-------------------+
> | Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
> +-----------------------+------------------------+-------------------+
> |          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
> |              http://www.cafeconleche.org/books/xian2/              |
> |  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
> +----------------------------------+---------------------------------+
> |  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
> |  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
> +----------------------------------+---------------------------------+


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]