Re: gtk-doc xml stuff

Matthias Clasen wrote:

You can achieve the same with entities (SUBDOC entities). But it is not so
important that the sections are valid, its more important the the resulting document is valid. And you loose validation for IDREFs if you move to xinclude, AFAIK.
I just did a test of xincludes, and xmllint can definitely check the idrefs if you pass the --postvalid argument (which validates after parsing). Here is an example:

----- Start foo.xml -----
<?xml version="1.0" standalone="no"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"

<sect1 id="some-id" xmlns:xi="";>
 <title>Some section</title>

 <para>This is a link to <link

 <xi:include href="bar.xml" />
----- End foo.xml -----

----- Start bar.xml -----
<?xml version="1.0" standalone="no"?>
<!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"

<sect2 id="my-sect2">

 <para>Here is another link to <link

 <sect3 id="some-id">

   <para>Repeat id!</para>
----- End bar.xml -----

Save these two files, then run xmllint:

$ xmllint --noout --xinclude --postvalid foo.xml
ID some-id already defined
Document foo.xml does not validate

The document foo.xml will not validate before xinclude processing (due to the <xi:include/> element) but this isn't that big a deal.


Email: james daa com au              | 2003 Call for Papers out
WWW: |

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]