[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Reusing <section> where a <chapter> should be - and the reverse
I often need to reuse <chapter> and <section> from one document in other documents. Frequently, I find that the content that I am reusing is a <section> in one book and must be at the top level of another book. Because <section> is not allowed at the top level of <book> and <chapter> cannot occur anywhere except in <book>, I have trouble reusing the content of sections and chapters in other documents. Specifically, I need to include the content of a <chapter> element as a child of a <section> element. Also I need to include the content of a <section> element as a child of <book>. Reading Chapter 22. Modular DocBook files in DocBook XSL led me to believe that the following xi:include could solve the problem for me. I expect it to include every child element of a <section> element in the <chapter> element. <chapter> <xi:include href="docbook-file-containing-the-modular-content.xml" xmlns:xi="http://www.w3.org/2001/XInclude" xpointer="element(IdOfTheSectionElement/*)" /> </chapter> But the xi:include fails. I use xmllint to resolve xi:includes. It gives the following errors: docbook-file-that-is-including.xml:11: element include: XInclude error : XPointer evaluation failed: #element(IdOfTheSectionElement/*) docbook-file-that-is-including.xml:11: element include: XInclude error : could not load docbook-file-containing-the-modular-content.xml, and no fallback was found Is my xpointer syntax incorrect? Other xi:includes from the same source file resolved without any trouble (they include entire elements). Is there a better way to reuse <section> and <chapter> elements in each other's hierarchical places? In case it matters, here's my xmllint version: $ xmllint --version xmllint: using libxml version 20626 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 Thanks for your help! Peter Desjardins
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]