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
[email protected]


----- Original Message ----- From: "Sam Steingold" <[email protected]>
To: <[email protected]>
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 <!DOCTYPE> and thus can only be included
using xinclude.
my toolchain is xmllint+xsltproc.
I use docbook 4.5.

so, my main file now says:
===================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"  "..." [
...
]>

<book id="impnotes-top"
     xmlns="http://docbook.org/ns/docbook";
     xmlns:xi="http://www.w3.org/2001/XInclude";>
<title>Implementation Notes for &gnu; &clisp;</title>

.....

<xi:include href="http://www.gnu.org/licenses/fdl.xml";>
<xi:fallback><appendix id="gfdl"><title>GNU Free Documentation License</title>
  <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"><title>GNU General Public License</title>
  <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 <[email protected]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to