Skip to main content
4everJang
Legend
February 17, 2012
Answered

Can I include unstructured files in the general rule for a book ?

  • February 17, 2012
  • 2 replies
  • 1502 views

Hi,

I have a series of books with lots of generated files. I want to keep those as they are, but still add structure to the book and the content chapters. How do I write a general rule for the book element that allows an unstructured component - i.e. without wrapping the unstructured content into a container first (which would involve structuring the generated files with a special conversion table just to set the root element for them). Is this possible at all ?

Thanks

Jang

This topic has been closed for replies.
Correct answer Michael_Müller-Hillebrand

Jang,

the general rule for your TOC would be <ANY> and then you can wrap the book component in the book’s structure into TOC.

- Michael

2 replies

4everJang
4everJangAuthor
Legend
February 17, 2012

Hi Michael,

Your method works fine. Thanks. I don't need any roundtripping or exporting to XML but if I do, this allows me to drop the content of the element that I wrapped the book component into. Now I just need to walk through the book on element level and automatically wrap the book components.

Ciao

Jang

Michael_Müller-Hillebrand
Legend
February 17, 2012

Jang,

the general rule for your TOC would be <ANY> and then you can wrap the book component in the book’s structure into TOC.

- Michael

Legend
February 17, 2012

Michael,

I don't think that is quite right for what Jang is asking. The book element rule should allow <TEXT> anywhere that an unstructured file is desired. Then, the unstructured files (<BOOK-COMPONENT> elements) can be valid in the book structure. I think <ANY> at the book element would work too.

There would be no general rule for the TOC, because it is unstructured.

Russ

Michael_Müller-Hillebrand
Legend
February 17, 2012

Well,

In my projects the DTD/EDD has an element for the TOC and/or Index, both are defined as <ANY>. The unstructured book component is then wrapped into the appropriate element in the book’s Structure View and gives you something like this:

I am sure there are other ways to handle the population of a structured book with some unstructured files, but this is how I do/did it in several projects.

Using the R/W rules I exclude the content of e.g. <toc> from the XML.

- Michael