XML in InDesign – guest post by Chris Chinchilla [15.09.2010]
Following on from last months post on XML, now it’s time to actually create a document using the publisher’s friend, InDesign. It’s a pretty easy process but requires a little planning and keeping an eye on what you’re doing. XML is a way of structuring data, so the first stage is to decide what constitutes your items of content, for example, starting with the top level of data…
- Book
- Chapters
- Item
- Title
- Body
- Details
In this example, our book consists of chapters with a variety of items in each chapter, with each item possessing a number of ‘properties’. Bearing all this in mind lets head to Indesign and the Structure pane, found from the View –> Structure –> Show Structure menu item.
Next bring up the Tags panel from the View –> Tags menu. The Structure pane shows our document’s current structure and the tags pane lets us identify individual components of our document, perhaps an example will clarify this.
Create the constituent parts outlined above in the Tags pane, using the ‘new tag’ button, giving each an appropriate name.
Now to assemble the structure…
As always, this is just the way I do it. It may not be the best or most obvious way, but it works for me. In the Structure pane, select ‘New Element’ from the panel’s sub menu and select ‘Chapter’, then select the newly created ‘Chapter’ element, doing the same again and select ‘Item’. To assemble the constituent parts of an item, select the parts on your page and tag them using the respective tag in the tags pane, now drag the items into the appropriate place in the structure on the structure pane.
This is the very beginning of both the process and of what is possible. You might want to apply this process to a master page and then create new pages from those. You can also create structural elements from mapping tags to styles and much more, this is purely an introduction.
To finish what we’ve started, to get hold of our XML, select File –> Export and select XML from the file types. We’ll ignore most of the options in the dialogue box, but some may seem slightly familiar from last months post or may seem fairly obvious as to their use. Open up the recently created XML file in a text editor or Internet browser. It won’t look like much at all, but it is valid XML that can now be used for a variety of purposes and as we add elements and attributes to our document it will become more useful and functional. If we are already creating books with InDesign then only a little extra work will mean we have content easily convertible to a variety of formats and the click of a button.
Chris Chinchilla has been a ground breaking eZine writer, indie rockstar, solo troubadour, professional geek, activist, street press writer and much more… He believes in not preaching to the converted and breaking open ideas to make them appealing and accesible to everyone. Now as the new publisher at aduki Independent press he intends to do much the same. Watch this space…
Subscribe to our RSS feed
Follow us on Twitter