Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Digital publishing /

Using XML to automate production of digital publications

by Andrew Zivic

Andrew Zivic

Content

  • Overview and demo
  • The process
  • Where to go from here

Created

16 April 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
content management customization design digital publishing Digital Publishing Suite

Requirements

Prerequisite knowledge

Prerequisite knowledge

Basic understanding of InDesign and DPS workflows.

Required Adobe products

·       InDesign CS5 or later

·       Digital Publishing Suite

User level

All

Required products

  • InDesign CS5.5 (Download trial)
  • Digital Publishing Suite

Sample files

  • xml_to_indesign_demo_assets.zip

Note: If you have questions about this article, use the comments feature at the bottom of the article. Please don’t contact technical support with questions about Adobe Developer Connection articles.

Digital Publishing Suite can be used to create a wide range of digital publications, from very hands-on, highly designed magazines to template-driven newspapers and catalogs. This article describes how InDesign and DPS can be used to create structured publications that retain some of the design aesthetic of highly designed publications and also take advantage of the efficiency benefits gained by using InDesign Templates and XML.

Overview and demo

Structured publications are often published on a frequent schedule (such as daily or weekly) and often obtain content from many different sources, such as XML and RSS feeds. Publishers who produce these publications often wish to strike a balance between design aesthetic and time-to-publish efficiency. Ideally, they'd like to be able to combine the layout detail of InDesign documents with the efficient import characteristics of XML and HTML.

The great news is that this type of production is entirely possible by using a combination of InDesign Templates, XML tagging, InDesign Scripting, and DPS Import.

XML, scripting, and InDesign

The demo assets and step-by-step instructions of this article demonstrate a simple example of how the technologies work together. For more details on any of the features, please refer to the XML and Scripting sections of the InDesign documentation. Note also that each of the actions below can be called using InDesign scripting. Automating the XML import process with InDesign scripts can unlock a level of efficiency needed for producing weekly and daily digital publications with DPS.

Running the demo

  1. Download and unzip the XML_to_InDesign_Demo_Assets.zip file.
  2. Open the ArticleTemplate.indt InDesign Template file in InDesign. Note that this results in creation of a new InDesign document with empty placeholder frames for content.
  3. Choose File > Import XML, select the Article1.xml file, and click through the default choices in the import wizard.
  4. InDesign imports the content from the XML file and places it in the corresponding placeholder frames that have been tagged with each of the XML element names.
  5. Repeat steps 1–3, but select Article2.xml. Note that the same InDesign template is now populated with different content.

The process

A logical way to begin creating the assets for your automated production system isby looking at the data feed(s) you have. In this case, Article.xml is a single file that contains all the data for this article. In real-world situations, article data might come from live data feeds (XML, RSS, or elsewhere) or it might be taken from a home-grown data aggregation system. Either way, it's important to start by understanding the structure of the data you're working with.

Map XML tags to frames in an InDesign template

The Article.XML file contains everything I need to generate an article: <title>, <teaser>, <byline>, <caption>, <text>, and three images <image1>, <image2>, and <image3>. In an automated environment, I would expect that each article I generate in the magazine would consist of these items, and the InDesign template I use will contain placeholder frames where the data for each of these items should go.

The next step is to create an InDesign template. This is easily done by opening a blank InDesign document and saving it as an InDesign template (File > Save As > InDesign Template (.indt). When an InDesign template is opened in InDesign, it copies all the existing contents of the template (including, in this case, empty placeholder frames) into a new, untitled InDesign document (.indd).

Next, add empty frames in the document where you want the images and text content to be placed. In this case, I created three empty frames for the images (one on each page), an empty frame for the title, teaser, and byline on the first page, and four separate frames (linked) on the second and third page to hold the article text.

The final step is to tag each of the empty frames with the corresponding content tags in the XML document. InDesign facilitates this process in the Tags panel (Window > Utilities > Tags) by using the Load Tags function in the pop-up menu. Click this function and point the Open File dialog to the Article.XML file.

The end result is a complete list of all the tags (color-coded) in the XML document now imported into the Tags panel. To associate each tag with its corresponding placeholder frame in the document, right-click the placeholder frame, select Tag Frame, and then choose the matching XML tag (see Figure 1).

Selected frame is tagged "caption"—indicated with underline in the Structure pane, and highlighted in the Tags panel
Selected frame is tagged "caption"—indicated with underline in the Structure pane, and highlighted in the Tags panel

Define XML structure and import assets

You're almost done now. The final step is to build the XML structure for the data that will be imported. Start by opening the Structure Pane (View > Structure > Show Structure). Note that a root tag named "root" has been inserted automatically. Since the root tag in the XML document is "article", this needs to be replaced. To do this, click on the "article" tag in the Tags panel and drag and drop it onto the root tag in the Structure pane. This will replace the name "Root" with "Article."

Now the document is ready to import the XML data. Select File > Import XML, and click through the default options. The end result is the data in each of the tags in the XML document is loaded into its corresponding placeholder frame in the InDesign document (see Figure 2). You can name and save the document into a unique directory—and then add it to your folio as an individual article.

Figure 2. Document, after importing the Article1.xml file
Figure 2. Document, after importing the Article1.xml file

Summary

Although the demo illustrates the import of only two articles, the implication is that the process can be used (and automated) to import as many articles with the same structure as needed for a publication. The power of this concept is enormous—it's possible to build a single, nicely designed template with a structure that's common to all articles, and then repeat the import process for every article that's designed for that format. The generic process is as follows:

  1. Open your empty InDesign template.
  2. Run the Import XML process.
  3. Save the document.
  4. Add it to your folio.
  5. Repeat these steps for each article.

Where to go from here

If you want to take this a step further, check out the Scripting documentation in InDesign Help. Using InDesign Scripting, it's possible to automate the first three steps listed above. Be sure to save your documents into unique subdirectories with the naming conventions required for DPS folios. Once you have a set of subdirectories populated with all the article content, you can use the Import function in the Folio Builder panel to import all the articles into a single folio. Voila! You've automated the process of creating an entire folio—and you can repeat and run this process as often as needed: monthly (for a magazine), weekly (for a weekly), or daily (for a newspaper).

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License+Adobe Commercial Rights

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

More Like This

  • Enabling promotional entitlement with Digital Publishing Suite
  • Custom storefront hands-on tutorial
  • Integrate publishing workflows and editorial systems with DPS
  • Enhance your DPS folios with HTML animations using Adobe Edge
  • Leveraging direct entitlement with Digital Publishing Suite
  • Adding Digital Publishing Suite apps to Apple Newsstand
  • Digital Publishing Suite overview
  • Digital Publishing Suite: Three editions
  • Digital Publishing Suite hands-on tutorial
  • Integrated social sharing with Digital Publishing Suite

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement