After
you have created and tagged placeholder frames, tables, and text—and made
sure that your document and the incoming XML file have the same
tags and structure—you can import XML content into your layout.
You
must use the Merge Content option to import XML into placeholders
(or to replace existing content in your document). When merging
content, InDesign replaces identically tagged and structured elements
in your document with the imported XML elements. You can use additional
import options to exclude imported (that is, filter) content that
doesn’t match the document structure, to delete document items that
aren’t matched or replaced by the imported XML, and to clone repeating
XML elements.
If the imported XML file contains elements that
are not found in the document, InDesign places these elements in
the Structure pane without laying them out in your document.
To
successfully merge XML into placeholders, keep these rules in mind:
Tag placeholders with the identical tag name as the XML element
that will replace it (or be flowed into it).
In placeholder text, make sure any spacing, returns, tabs
or static text is outside the placeholder element tags, but within
the parent element for the story.
When you import the XML, select Do Not Import Contents Of
Whitespace-Only Elements. (This preserves spacing and static text
if the XML elements you import consist of white spaces only.)
When importing and placing XML data using the
Merge Content option, the XML Import Options dialog box offers the
following options:
Create Link
Links to the XML file so that if the XML file is updated,
you can update its XML data in your InDesign document.
Apply XSLT
Applies a stylesheet
to define the transformation of the imported XML. Select Browse
(Windows) or Choose (Mac OS) to select an XSLT file (.xsl or .xslt)
from the file system. Use Stylesheet From XML, the default option,
causes InDesign to use an XSLT processing instruction, if one is
present in the XML file, to transform the XML data.
Clone Repeating Text Elements
Replicates the formatting applied to tagged placeholder text
for repeating content. Create one formatting instance (for example,
an address), and then reuse its layout to create other instances automatically.
(See Working with repeating data.)
Only Import Elements That Match Existing Structure
Filters the imported XML content so that only elements from
the imported XML file with matching elements in the document are
imported.
Import Text Elements Into Tables If Tags Match
Imports elements into a table if the tags match the tags
applied to the placeholder table and its cells. For example, use
this option to place database records into a table when generating price
lists or inventory sheets.
Do Not Import Contents Of Whitespace-only Elements
Leaves any existing content in place if the matching XML
content contains only whitespace (such as a return or tab character).
Use this option if you’ve included text between elements in your
placeholder frames and you want to preserve this text. For example,
when laying out recipes generated from a database, you might add labels
such as “Ingredients” or “Instructions.” As long as the parent element
that wraps each recipe contains only whitespace, InDesign leaves
the label in place.
Delete Elements, Frames, and Content That Do Not Match
Imported XML
Removes elements from the Structure pane and the layout of
the document if they don’t match any elements in the imported XML
file. Use this option to filter data from the document. For example,
when importing names and addresses, you might have placeholder text
for an element containing the company name. If one of the names
doesn’t include the company element, InDesign deletes the element
containing the placeholder text.
Import CALS Tables As InDesign Tables
Imports
any CALS tables in the XML file as InDesign tables.
Comments
Comments are no longer accepted for InDesign CS3. InDesign CS4 is the current version. To
discuss InDesign CS3, please use the Adobe forum.
Comments
Comments are no longer accepted for InDesign CS3. InDesign CS4 is the current version. To discuss InDesign CS3, please use the Adobe forum.