Copy link to clipboard
Copied
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
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Michael,
I see what you are talking about now. That would work too.. just requires an extra step or two.
Russ
Copy link to clipboard
Copied
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
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more