This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Xref ID problem


"E.L. Willighagen" wrote:

> <?xml version="1.0"?>
Insert proper document type declaration here:

<!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.1.2//EN' 		     
'http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd'>

> <book>
>   <bookinfo>
>     <title>Some Documentation</title>
>   </bookinfo>
> ...
>
> when compiling with XT and norman's xsl stylesheets, i get this error:
> 
> file:/home/egonw/CVS/Jmol/doc/source/text.xml:12: Error: no ID for constraint linkend: ch02.
> 
> What is wrong with <chapter id="ch02">??

Links in DocBook rely on ID/IDREF mechanism. In order to use them, you
must provide correct DOCTYPE at the start of your document. DOCTYPE
points to DTD, where are some attributes defined as of type ID (id
attribute) and some as IDREF type (linkend attribute). This information
is neccesary to proper handle links in document. 

In fact, it is possible in XSLT to not rely on ID/IDREF mechanism, and
use key() function together with <xsl:key> instruction instead. AFAIK
XSLT stylesheet does not use this mechanism, they use id() function. One
advantage of using ID/IDREF solution is, that parser is able to check
correctness of all links at the parse time.

-----------------------------------------------------------------
  Jirka Kosek  	                     
  e-mail: jirka@kosek.cz
  http://www.kosek.cz

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]