EasyManua.ls Logo

Adobe 0046100128056 - InDesign - Mac - XML; Overview

Adobe 0046100128056 - InDesign - Mac
209 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
165
12
XML
Extensible Markup Language, or XML, is a text-based mark-up system created and managed by the World
Wide Web Consortium (www.w3.org
). Like Hypertext Markup Language (HTML), XML uses angle brackets
to indicate markup tags (for example,
<article> or <para>). While HTML has a predefined set of tags,
XML allows you to describe content more precisely by creating custom tags.
Because of its flexibility, XML increasingly is used as a format for storing data. InDesign includes a complete
set of features for importing XML data into page layouts, and these features can be controlled using
scripting.
We assume you already read Adobe InDesign CS5 Scripting Tutorial and know how to create and run a script.
We also assume you have some knowledge of XML, DTDs, and XSLT.
Overview
Because XML is entirely concerned with content and explicitly not concerned with formatting, making
XML work in a page-layout context is challenging. InDesign’s approach to XML is quite complete and
flexible, but it has a few limitations:
X Once XML elements are imported into an InDesign document, they become InDesign elements that
correspond to the XML structure. The InDesign representations of the XML elements are not the same
thing as the XML elements themselves.
X Each XML element can appear only once in a layout. If you want to duplicate the information of the
XML element in the layout, you must duplicate the XML element itself.
X The order in which XML elements appear in a layout largely depends on the order in which they
appear in the XML structure.
X Any text that appears in a story associated with an XML element becomes part of that element’s data.
The Best Approach to Scripting XML in InDesign
You might want to do most of the work on an XML file outside InDesign, before you import the file into an
InDesign layout. Working with XML outside InDesign, you can use a wide variety of excellent tools, such as
XML editors and parsers.
When you need to rearrange or duplicate elements in a large XML data structure, the best approach is to
transform the XML using XSLT. You can do this as you import the XML file.
If the XML data is already formatted in an InDesign document, you probably will want to use XML rules if
you are doing more than the simplest of operations. XML rules can search the XML structure in a
document and process matching XML elements much faster than a script that does not use XML rules.
For more on working with XML rules, see Chapter 13, “XML Rules
."

Table of Contents