En poussant les recherches, je suis tombé sur la page
http://www.sagehill.net/docbookxsl/ProcesingDb5.html de Stayton, qui
prétend qu'xmllint ne prends pas en compte schematron.
Pourtant :
tom@geekette:~$ xmllint --version
xmllint: using libxml version 20627
compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1
FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude
Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron
Modules Debug Zlib ##########
Bref, s'agit-il d'un support partiel, ou bien dois-je m'interroger
sur mes capacités d'analyse ? Curieusement, j'arrive à sortir un "book"
de 60 pages et pas un article de 2...
xmllint --valid --noout includes/article-exemple.xml => RAS
tom@geekette:~/xml_howto$ xmllint --valid --noout --relaxng
http://docbook.org/xml/5.0/rng/docbookxi.rng
includes/article-exemple.xml
includes/article-exemple.xml:46: element sect1: Relax-NG validity error
: Did not expect element sect1 there
includes/article-exemple.xml:31: element bibliography: Relax-NG validity
error : Expecting element example, got bibliography
includes/article-exemple.xml:31: element bibliography: Relax-NG validity
error : Did not expect element bibliography there
includes/article-exemple.xml:31: element bibliography: Relax-NG validity
error : Expecting element bridgehead, got bibliography
includes/article-exemple.xml:31: element bibliography: Relax-NG validity
error : Expecting element annotation, got bibliography
includes/article-exemple.xml fails to validate
tom@geekette:~/xml_howto$
en gros, la structure de mon document est :
(je maintiens la DTD pour les entités « texte »)
<?xml version="1.0" encoding="UTF-8"?>
<!-- vim: set expandtab tabstop=2 shiftwidth=2: -->
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN"
"http://docbook.org/xml/5.0/dtd/docbook.dtd"
[
<!ENTITY og "« ">
<!ENTITY fg " »">
<!ENTITY mdash "—">
]>
<article xmlns="http://docbook.org/ns/docbook"
version="5.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:lang="fr">
<info>
<title>Exemple de fichier docbook 5.0</title>
...
<abstract>
<para>Ceci est un exemple de fichier docbook.</para>
</abstract>
</info>
<bibliography>
<biblioentry>
<author>
<personname>
...
</personname>
</author>
</biblioentry>
</bibliography>
<sect1>
<title>Une section</title>
<sect2>
<title>Une sous-section</title>
<para>Paragraphe contenu dans la sous-section.</para>
</sect2>
<sect2>
<title>Listes</title>
...
</sect2>
</sect1>
<sect1>
<title>Une seconde section</title>
<para>Un paragraphe de la seconde section</para>
</sect1>
</article>
Où est l'erreur ?
--
Thomas Harding