I'm trying to validate some documents generated by the db4-upgrade.xsl from
existing (validating) db4 documents. Validating the resulting db5 results in
mysterious errors that don't seem to correspond to actual problems. Eventually I
figured out that if I inlined content that had originally been XIncluded, the
errors went away. The especially mystifying part is that the reported errors
are in parts of the document having nothing to do with the apparently
offending xi:include element.
Should I expect xmllint to operate properly with XIncludes? xmllint doesn't
have any problems validating the original db4 documents, which also contain
XIncludes, so it seems to be somehow related to db5, but I'm out of my depth at
this point.
I've attached a (relatively) minimal case below; valid.xml inlines
the file, invalid.xml instead XIncludes it. Running
xmllint --noout --xinclude --relaxng http://docbook.org/xml/5.0/rng/docbook.rng
valid.xml invalid.xml
results in
valid.xml validates
invalid.xml:27: element variablelist: Relax-NG validity error : Expecting
element example, got variablelist
invalid.xml:37: element variablelist: Relax-NG validity error : Element
refsection has extra content: variablelist
invalid.xml:34: element refsection: Relax-NG validity error : Element refentry
has extra content: refsection
invalid.xml fails to validate
but the xi:include element in invalid.xml doesn't occur until line 48, well
after the reported errors.
I attempted using jing on these documents to try and see if this behavior
is an xmllint-specific problem, but it appears to just hang up forever (not the
case with other schema and documents I've used jing on). Are there any
other validators I should be trying on Debian 7?
Thanks,
Jon Leech
<!DOCTYPE refentry [
<!ENTITY % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
%mathml;
]>
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glTexImage1D">
<info>
<copyright>
<year>1991-2006</year>
<holder>Silicon Graphics, Inc.</holder>
</copyright>
</info>
<refnamediv>
<refname>glTexImage1D</refname>
<refpurpose>specify a one-dimensional texture image</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glTexImage1D</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection xml:id="parameters"><info><title>Parameters</title></info>
<variablelist>
<varlistentry>
<term>aterm</term>
<listitem><para>text</para></listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection xml:id="description"><info><title>Description</title></info>
<para>
</para>
<variablelist>
<varlistentry>
<term><constant>GL_RED</constant></term>
<listitem>
<para> </para>
</listitem>
</varlistentry>
</variablelist>
<para> </para>
<!-- valid.xml includes the contents of baseformattable.xml inline -->
<para>
<table frame="topbot"><info><title>Base Internal Formats</title></info>
<tgroup cols="3" align="left">
<colspec align="left"/>
<colspec align="left"/>
<colspec align="left"/>
<thead>
<row>
<entry rowsep="1" align="left"><emphasis role="bold">
Base Internal Format
</emphasis></entry>
<entry rowsep="1" align="left"><emphasis role="bold">
RGBA, Depth and Stencil Values
</emphasis></entry>
<entry rowsep="1" align="left"><emphasis role="bold">
Internal Components
</emphasis></entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>GL_DEPTH_COMPONENT</constant></entry>
<entry>Depth</entry>
<entry>D</entry>
</row>
<row>
<entry><constant>GL_DEPTH_STENCIL</constant></entry>
<entry>Depth, Stencil</entry>
<entry>D, S</entry>
</row>
<row>
<entry><constant>GL_RED</constant></entry>
<entry>Red</entry>
<entry>R</entry>
</row>
<row>
<entry><constant>GL_RG</constant></entry>
<entry>Red, Green</entry>
<entry>R, G</entry>
</row>
<row>
<entry><constant>GL_RGB</constant></entry>
<entry>Red, Green, Blue</entry>
<entry>R, G, B</entry>
</row>
<row>
<entry><constant>GL_RGBA</constant></entry>
<entry>Red, Green, Blue, Alpha</entry>
<entry>R, G, B, A</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</refsection>
</refentry>
<!DOCTYPE refentry [
<!ENTITY % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
%mathml;
]>
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glTexImage1D">
<info>
<copyright>
<year>1991-2006</year>
<holder>Silicon Graphics, Inc.</holder>
</copyright>
</info>
<refnamediv>
<refname>glTexImage1D</refname>
<refpurpose>specify a one-dimensional texture image</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glTexImage1D</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsection xml:id="parameters"><info><title>Parameters</title></info>
<variablelist>
<varlistentry>
<term>aterm</term>
<listitem><para>text</para></listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection xml:id="description"><info><title>Description</title></info>
<para>
</para>
<variablelist>
<varlistentry>
<term><constant>GL_RED</constant></term>
<listitem>
<para> </para>
</listitem>
</varlistentry>
</variablelist>
<para> </para>
<!-- invalid.xml includes the contents of baseformattable.xml using XInclude -->
<para>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="baseformattable.xml"/>
</para>
</refsection>
</refentry>
<!-- db5 version, drops DOCTYPE declaration and adds <info> around <title> -->
<table frame="topbot"><info><title>Base Internal Formats</title></info>
<tgroup cols="3" align="left">
<colspec align="left"/>
<colspec align="left"/>
<colspec align="left"/>
<thead>
<row>
<entry rowsep="1" align="left"><emphasis role="bold">
Base Internal Format
</emphasis></entry>
<entry rowsep="1" align="left"><emphasis role="bold">
RGBA, Depth and Stencil Values
</emphasis></entry>
<entry rowsep="1" align="left"><emphasis role="bold">
Internal Components
</emphasis></entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>GL_DEPTH_COMPONENT</constant></entry>
<entry>Depth</entry>
<entry>D</entry>
</row>
<row>
<entry><constant>GL_DEPTH_STENCIL</constant></entry>
<entry>Depth, Stencil</entry>
<entry>D, S</entry>
</row>
<row>
<entry><constant>GL_RED</constant></entry>
<entry>Red</entry>
<entry>R</entry>
</row>
<row>
<entry><constant>GL_RG</constant></entry>
<entry>Red, Green</entry>
<entry>R, G</entry>
</row>
<row>
<entry><constant>GL_RGB</constant></entry>
<entry>Red, Green, Blue</entry>
<entry>R, G, B</entry>
</row>
<row>
<entry><constant>GL_RGBA</constant></entry>
<entry>Red, Green, Blue, Alpha</entry>
<entry>R, G, B, A</entry>
</row>
</tbody>
</tgroup>
</table>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]