XML technologies / DocBook / Conditional elements (profiling) / Profiling and validation
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
Validation can take place at two stages:
- Before profiling
Validate the original document. It is recommended to make it valid. With a customized DocBook schema, some constructs may not be allowed.
- After profiling
Validate the variant, the filtered document. It must be valid because subsequent steps rely on it.
Keep these points in mind when profiling:
- IDs (
idorxml:id) Identifiers must be unique throughout the document. Duplicate IDs cause validation errors. Create only one element with the desired ID and add profiling attributes inside the content.
- Titles
Since duplicate titles are invalid in DocBook, use inside
titlethe elementphraseand add the corresponding profiling attributes there.- Nesting
Profiling attributes at different structural levels increase complexity. Test the combinations to ensure every variant is valid. Reduce nesting depth where possible.
- Index ranges
An index range has a start and end (see Index ranges). If profiling removes either endpoint, the range is invalid. The simplest solution is to use ordinary index entries instead. Otherwise, test the different combinations.
To validate the profiling result, first perform profiling as described in Two-pass profiling. Validate the resulting DocBook document with your XML parser.
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top