XML: Docbook Error with using para with @id
I've been trying to get pages references to work for my xsl-fo and concept is to add a blank tag you can reference as the the last page t开发者_StackOverflow中文版hat will be processed. So my table of contents looks something like this...
<?xml version="1.0" encoding="UTF-8"?>
<article
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="http://docbook.org/ns/docbook http://www.w3.org/2001/XInclude">
<xi:includes
... (lots of them)
<xi:includes>
<para id="last-page"/>
</article>
So ideally i just reference last-page
. But with this i get an validation error:
[ERROR]contents.xml:154:27: cvc-complex-type.2.4.a: Invalid content was found starting with element 'para'. One of '{"http://docbook.org/ns/docbook":section, "http://docbook.org/ns/docbook":simplesect, "http://docbook.org/ns/docbook":glossary, "http://docbook.org/ns/docbook":bibliography, "http://docbook.org/ns/docbook":index, "http://docbook.org/ns/docbook":toc, "http://docbook.org/ns/docbook":appendix, "http://docbook.org/ns/docbook":acknowledgements, "http://docbook.org/ns/docbook":colophon}' is expected.
[ERROR]contents.xml:154:27: cvc-complex-type.3.2.2: Attribute 'id' is not allowed to appear in element 'para'.
I've tried removing that docbook from the schema, and I get other errors. What should i try instead to fix this?
The schema does not allow a para element at the end of the article. As the error message says, one of section, simplesect, glossary, bibliography, index, toc, appendix, acknowledgements, colophon is expected.
The id attribute has been replaced by xml:id in DocBook 5.
I guess that the purpose is to produce "Page x of y" page numbering in the output. Do take a look at the "Page x of y numbering" section here: http://www.sagehill.net/docbookxsl/PrintHeaders.html#ConsecutivePageNumbers.
精彩评论