Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Advocate ,
Feb 17, 2012 Feb 17, 2012

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

TOPICS
Structured
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Feb 17, 2012 Feb 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

Translate
Advocate ,
Feb 17, 2012 Feb 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 17, 2012 Feb 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 17, 2012 Feb 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:

book_toc_structure.png

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 17, 2012 Feb 17, 2012

Michael,

I see what you are talking about now. That would work too.. just requires an extra step or two.

Russ

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 17, 2012 Feb 17, 2012
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines