O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

XML and InDesign

Book Description

Discover the power of XML publishing with InDesign, and create content for multiple applications—including digital-first publishing workflows. With this book, XML evangelist Dorothy Hoskins teaches you several techniques for working with the built-in XML capabilities of InDesign CS6, using real examples from a college course-catalog project.

Learn how to import database content into InDesign, and tag existing InDesign content as XML for export to other applications. InDesign also lets you apply attractive styling to XML content that can’t be done with XSL-FO. Through step-by-step instructions, code examples, and lots of screen shots, you’ll discover how using XML with InDesign increases the value of your content.

  • Get an overview of structured (XML) content
  • Learn InDesign’s XML import options, including XML image information
  • Mingle XML and non-XML content in a text flow
  • Use InDesign as an XML "skin" by making templates with new style definitions
  • Put content in "XML order" for export to EPUB, with InDesign CS5.5 and CS6
  • Dive into advanced topics, such as how to transform XML with XSL
  • Understand InDesign’s potential and limitations with complex content models such as DocBook and DITA

Table of Contents

  1. A Note Regarding Supplemental Files
  2. Preface
    1. About This Book and InDesign CS
    2. Conventions Used in This Book
    3. Using Code Examples
    4. Safari® Books Online
    5. How to Contact Us
    6. Contributor
      1. Acknowledgments
  3. 1. A Brief Foray into Structured Content (a.k.a. XML)
  4. 2. InDesign XML Publishing: College Catalog Case Study
    1. Data-Like Content Example: The Course Description XML
      1. Data Exported as XML
      2. Modeling the Structure for the Import XML
    2. Topical Content: The Handbook XML
      1. Evaluating the Handbook Text for Structure
      2. Modeling the Structure as a Set of Topics
      3. Iteration and Refinement
      4. Net Results: Vast Improvements in Understanding and Speed
  5. 3. Importing XML
    1. Doing It Adobe’s Way: The Placeholder Approach
      1. Modeling the XML You Want
        1. Getting some structure into InDesign
        2. Create placeholders for XML elements
        3. Creating test XML
      2. Importing XML into Placeholders
        1. Adding style to the XML elements
        2. Mapping styles to tags
        3. Importing the “real” XML file
      3. An Aside: The Scary “Map Styles to Tags” Dialog Message
    2. Mingling Non-XML and XML Content in a Text Flow
      1. Exporting XHTML When XML is in Your InDesign File
    3. Doing It Your Way: Using the Options for Your Own Process
      1. Import XML Using Only Merge—No Other Import Settings
        1. Using Append
      2. Linking to External XML Files
        1. External updates on Open and using the Links palette
      3. Creating Text Flows for the Imported XML
      4. The Importance of “Document Order” for Imported XML
        1. Rearranging XML elements in the structure pane
        2. Fixing up structure in the Story Editor
    4. Understanding InDesign’s XML Import Options
      1. Using “Clone Repeating Text Elements”
      2. Importing Only Elements That Match Structure
      3. Avoiding Overwriting Text Labels in the Placeholder Elements
      4. Deleting Nonmatching Structure, Text, and Layout Components
    5. Importing Images
      1. Inline Image Imports
  6. 4. Tagging XML in InDesign
    1. The Case for Tagging Content: Why You Need XML
    2. Tagging for Import
    3. Tagging for Iterative XML Development
      1. Working Without an Initial DTD
  7. 5. Looking Forward: InDesign as an XML “Skin”
  8. 6. Exporting XML
    1. Marking Up (Tagging) Existing Content for XML Export
    2. The Special Case of InDesign Tables (Namespaced XML)
      1. Examining the Table
    3. Tagging Images as XML in InDesign
      1. Image Options in the Export XML Dialog
  9. 7. Exporting ePub Content (InDesign CS5.5 and CS6)
    1. Export in XML Order Compared with Page Layout and Article Pane Order
    2. Alternate Layouts and XML Are Not Compatible Features
      1. Untested: Liquid Layout and InDesign Files Containing XML Structure
  10. 8. Validating XML in InDesign
    1. Why Validate?
    2. How to Validate XML in InDesign
      1. Loading a DTD and Getting the Correct Root Element
    3. Authoring with a DTD
      1. Dealing with Validation Problems
      2. Occurrence and Sequences of Elements
      3. Validating Outside of InDesign
      4. Duplicating Structure to Build XML
      5. Cleaning Up Imported XML Content
    4. Fast and Light Credo: Develop Now, Validate Later
      1. Iterating the Information Structure and DTD
  11. 9. What InDesign Cannot Do (or Do Well) with XML
    1. The 1:1 Import Conundrum
    2. Bad Characters
    3. Inscrutable Errors, Messages, and Crashes
    4. InDesign Is Not an XML Authoring Tool
  12. 10. Advanced Topics: Transforming XML with XSL
    1. XSLT for Wrangling XML versus XML Scripting for Automating XML Publishing
    2. XSL: Extracting Elements from a Source XML File for a New Use
    3. XSL: Getting the Elements to Sort Themselves
    4. XSL: Getting Rid of Elements You Don’t Want
    5. Creating Wrappers for Repeating Chunks
    6. Making a Table from Element Structures
    7. Upcasting Versus Downcasting
    8. Upcasting from HTML to XML for InDesign Import
    9. Downcasting to HTML
    10. Generate a Link with XSLT (Not Automated)
    11. Adding Useful Attributes to XML
      1. A General Formula for Adding Attributes
      2. Generating an id Attribute for a div
      3. Use of the lang Attribute for Translations
      4. Creating an Image href Attribute
        1. Paths to images
    12. A Word about Using Find/Change for XML Markup in InDesign
  13. 11. Content Model Depth Issues and Their Impact on Round-Tripping XML
    1. The Challenge of Mapping Deep DTDs to Shallow InDesign Structures
    2. The Challenge of Mapping Shallow Structures to Deep DTD Structures
    3. Use of Semantic ids and Style Names (Expert-Level Development)
  14. 12. Brief Notes
    1. A Brief Note about InCopy and XML
    2. A Brief Note about IDML and ICML
      1. Automating InDesign: The Power of IDML and ICML Programming
        1. An ICML developer’s test case
    3. Summary
  15. A. Resources
    1. InDesign Resources
    2. XML Resources
    3. XSLT Resources
  16. About the Author
  17. Colophon
  18. Copyright