This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] 5 Questions: from PHP tags to XIncludes
- From: "Bob Stayton" <bobs at sagehill dot net>
- To: "Frans Englich" <frans dot englich at telia dot com>, <docbook-apps at lists dot oasis-open dot org>
- Date: Sat, 24 Jul 2004 11:01:54 -0700
- Subject: Re: [docbook-apps] 5 Questions: from PHP tags to XIncludes
- References: <200407240652.56254.frans.englich@telia.com>
----- Original Message -----
From: "Frans Englich" <frans.englich@telia.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Friday, July 23, 2004 11:52 PM
Subject: [docbook-apps] 5 Questions: from PHP tags to XIncludes
> 5.
>
> I use XIncludes(with xsltproc/xmllint) in one of my files extensively, so
I
> tried putting the namespace declaration in a top element, as a much
shorter
> solution compared to declaring it in each element where it's used. But
> xmllint complained. Shouldn't I be able to do like this(plain xml syntax)?
>
> <book xmlns:xi="http://www.w3.org/2001/XInclude">
> [...]
> <xi:include href="kua1.xml" />
> [...]
> </book>
>
> bash-2.05b$ make check
> xmllint --nonet --xinclude --postvalid --noout kua*.xml book.xml
> book.xml:5: element book: validity error : No declaration for attribute
> xmlns:xi of element book
> Document book.xml does not validate
> make: *** [check] Error 3
> bash-2.05b$
Putting the namespace declaration in the book element is sufficient to
declare the namespace for the document, but it doesn't make xi:include a
valid attribute on any elements. The DTD determines what attributes are
valid because DocBook is not in its own namespace. See this reference for
more info for validing with XIncludes:
http://www.sagehill.net/docbookxsl/ValidXinclude.html#XincludeDTD
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net