Kate,
I think there may be a solution that does not require a change to the
schema.
I presume the toc becomes bloated because everything ends up getting
pushed down an extra level. If that's the case, try the following:
<book>
...
<chapter>
<title><xi:include href="section-to-include.xml"
xpointer="xmlns(d=http://docbook.org/ns/docbook)xpointer(/d:section/d:title/text()))"/></title>
<xi:include href="section-to-include.xml"
xpointer="xmlns(d=http://docbook.org/ns/docbook)xpointer(/d:section/d:title/following-sibling::*))"/>
</chapter>
...
</book>
This snippet throws away the section wrapper, promotes the title to be
the chapter title, and then pulls in everything after the title inside
the section. I've used it when I needed to turn a chapter into an
appendix or when I've needed to insert something (e.g., a graphic) and
didn't want to touch the source.
You need to be cautious about the content; it's not hard to end up with
a file that won't parse, but it might be worth a try.
Hope that helps.
Dick Hamilton
---------------------------------
XML Press
XML for Technical Communicators
http://xmlpress.net
(970) 231-3624
>
> Hello,
>
> Here's the problem that I am increasingly running into: We have a
> <section> in one book that we want to reuse as a <chapter> in another
> book and vice versa.
>
> For example, in book A, there is section about using a tool with
> product A and in book B, we need to include the same information, but
> it must exist at the chapter level.
> Currently, in order to solve this problem, in Book A we create a
> <section> that contains the information and we xinclude this <section>
> into an essentially empty <chapter> element in Book B. As a result,
> our TOC becomes bloated and we end up with these funny chapter pages
> (in HTML Help) that only contain vague sentences followed by links to
> sections.
>
> It would be easier for us if the book structure allowed the <section>
> element to exist at the same level as the <chapter> element.
> So that, for example, the following would be valid:
> <book><title>titletext</title>
> <section>text....
> </section>
> </book>
>
> I understand that the section element is supposed to contain
> information that is a section of something else and so the committee
> has been reluctant to see the <section> as a direct element of the
> <book> element. I had hoped that the <topic> element in modular
> DocBook would offer a better alternative. Unfortunately, from what I
> understand, you
> cannot have a topic embedded within a topic. So, even if we switched
> to using topics, we'd have the same problem as described above.
>
> Apologies if I am bringing up a subject that has already been
> addressed. Any suggestions as to how to solve this problem would be
> greatly appreciated.
>
> Thank you,
> Kate
>
>
> ..........................................................................................................................................................................................................................
>
>
>
> Kate Wringe | Tech Writer 2| Sybase
> 445 Wes Graham Way, Waterloo, ON,
> N2L 6R2 Canada | Tel: (519)
> 883-6838 | [email protected] |
> www.sybase.com
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]