Hi Sam,
Remove the --valid option. That triggers validation before the xi:include
element is processed. The --postvalid option handles validation after the
XIncludes are resolved.
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net----- Original Message -----
From: "Sam Steingold" <
sds@gnu.org>
To: <
docbook-apps@lists.oasis-open.org>
Sent: Monday, January 26, 2009 11:20 AM
Subject: [docbook-apps] cannot get XInclude to work
> Hi,
> I am forced to use xinclude because a file I used to include using a
> system entity now contains and thus can only be included
> using xinclude.
> my toolchain is xmllint+xsltproc.
> I use docbook 4.5.
>
> so, my main file now says:
> ===================================
>
> > ...
> ]>
>
> <book id="impnotes-top"
> xmlns="http://docbook.org/ns/docbook"
> xmlns:xi="http://www.w3.org/2001/XInclude">
>
>
> .....
>
> <xi:include href="http://www.gnu.org/licenses/fdl.xml">
> <xi:fallback><appendix id="gfdl">
> <para>internet connection to the &fsf; is broken</para></appendix>
> </xi:fallback></xi:include>
> <xi:include href="http://www.gnu.org/licenses/gpl2.xml">
> <xi:fallback><appendix id="gpl">
> <para>internet connection to the &fsf; is broken</para></appendix>
> </xi:fallback></xi:include>
>
> ....
> ===================================
>
> alas, I cannot validate:
>
> $ xmllint --xinclude --noout --valid --postvalid --timing --noent
> impnotes.xml
> impnotes.xml:49: element book: validity error : No declaration for
> attribute xmlns of element book
> xmlns:xi="http://www.w3.org/2001/XInclude">
> ^
> impnotes.xml:49: element book: validity error : No declaration for
> attribute xmlns:xi of element book
> xmlns:xi="http://www.w3.org/2001/XInclude">
> ^
> impnotes.xml:219: element include: validity error : No declaration for
> attribute href of element include
> <xi:include href="http://www.gnu.org/licenses/fdl.xml">
> ^
> impnotes.xml:222: element fallback: validity error : No declaration
> for element fallback
> </xi:fallback></xi:include>
> ^
> impnotes.xml:222: element include: validity error : No declaration for
> element include
> </xi:fallback></xi:include>
> ^
> impnotes.xml:223: element include: validity error : No declaration for
> attribute href of element include
> <xi:include href="http://www.gnu.org/licenses/gpl2.xml">
> ^
> impnotes.xml:226: element fallback: validity error : No declaration
> for element fallback
> </xi:fallback></xi:include>
> ^
> impnotes.xml:226: element include: validity error : No declaration for
> element include
> </xi:fallback></xi:include>
> ^
> impnotes.xml:228: element part: validity error : Element part content
> does not follow the DTD, expecting (beginpage? , partinfo? , (title ,
> subtitle? , titleabbrev?) , partintro? , (appendix | chapter | toc |
> lot | index | glossary | bibliography | article | preface | refentry |
> reference)+), got (title appendix xi:include xi:include )
> </part>
> ^
> Parsing took 527 ms
>
http://www.gnu.org/licenses/gpl2.xml:1: validity error : Validation
> failed: no DTD found !
> <appendix id="gpl">
> ^
> Xinclude processing took 207 ms
> impnotes.xml:49: element book: validity error : No declaration for
> attribute xmlns of element book
> impnotes.xml:49: element book: validity error : No declaration for
> attribute xmlns:xi of element book
> impnotes.xml:216: element part: validity error : Element part content
> does not follow the DTD, expecting (beginpage? , partinfo? , (title ,
> subtitle? , titleabbrev?) , partintro? , (appendix | chapter | toc |
> lot | index | glossary | bibliography | article | preface | refentry |
> reference)+), got (title appendix section appendix )
> impnotes.xml:73: element xref: validity error : IDREF attribute
> linkend references an unknown ID "gfdl"
> Document impnotes.xml does not validate
> Validating took 120 ms
> Freeing took 81 ms
> make: *** [check] Error 3
>
> --
> Sam Steingold <
sds@gnu.org>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
docbook-apps-unsubscribe@lists.oasis-open.org> For additional commands, e-mail:
docbook-apps-help@lists.oasis-open.org>
>
>