19 February 2016
Comments: 0

5 errors you will do with InDesign XML

XML Import within Adobe InDesign is tricky for rookies. It’s likely you will fall into one of its many pitfalls. You have to follow some rules if you want to get your catalog, directory or book project perfectly populated!

Here are 5 errors you will probably do unless you read carefully this article.

1) Ignore the true nature of XML

Importing a XML file within InDesign is a piece of cake. But once loaded, you may think you have a nice and layout free database. So eventually InDesign will pick whatever data it needs within that structure.

Well…not really.

InDesign XML is nothing but tagged text !

En important du contenu XML dans le document, on obtient un article !

In above figure, dropping a XML Element within the document will place all the nodes as a continuous tagged texts article.

Once you got that, next points will be easier to understand.

2) Import different structures

One of the hardest rule is that incoming structure MUST match the existing structure.
Not something you care on the original importation. However once a layout is set with all tags needed, it becomes dramatically important.

If you do import mismatching structures and think InDesign will dela with it…

You may suffer, a lot!

Imagine that basic structure:

Structure de base dans InDesign

And this existing structure.

<Root>
 <a>A</a>
 <c>C</c>
 <b>B</b>
</Root>

And you think InDesign will deal with your mess…?

Here is what you will get eventually:

Problemes d'import XML

When the incoming <a> tag found an appropriate <a> tag within InDesign (same index) and the content was placed within that node. Then a <c> comes in and found a <b> at its index. <c> says : “Hey, I am not a <b>, looking forward…”. Then <c> found a <c> and the content was placed.Then entered <b> after <c> but <b> couldn’t find any following <b> tag, so it was added as it.

Nothing close to what we could expect, right ?

At no point, InDesign is going to look backwards to deal with the incoming tags!

3) Overuse frames

Quite logically, rookies tend to use and abuse of frames. Once for the price, one for the description, etc. Eventually a “nature morte” of frames. Charming yet inefficient.

module_frame

Remember that your structure is text made. So keep in mind your fundamental brick is a story within a text frame. Whatever the nature of your project, it will starts with an unique text frame.

use boxes as few as possible

textRules

So try to mimick frames, position and spacings with texts attributes. A paragraph rule can simulate a frame. Leading, spaces after/before, indents and tabs can dispatch items like you would it would be isolated frames.

You tried that but you really need a floating frame for the pictures ? Well use anchored frames in combination of objet styles to layout control.

4) Forget styles

A few of you may already know that you can map tags to styles. It’s always good practice to use styles so any tags you try to add will be linked to the appropriate style.

association_styles

tarif_prix

style_applique

The “price” styles is automatically applied to the associated tag.

However one hiccup is that you can’t apply different styles to tags regarding to their location. For ex. you would like p tags to be in arial in text/p but in Times in headline/p. No way with mapping. You would have to set styles within the xml file thanks to aid namespaces and aid:pstyle and aid:cstyle to call styles more smoothely. An alternative is to use scripting.

5) Lack of abstraction

Catalog or directories projects tend to offer a repetitive pattern. A bad approach would be to set a really descriptive structure like below :

What you shouldn't do with XML

That could work somehow. However that would lead to a lot tagging within InDesign and would definitively lack of scalability. If you have two or three players, well why not but what if you have to work with hundreds ?

There is so much better to do !

Thanks to abstraction and some options, InDesign is going to work for us. Let’s consider that structure:

goodXMLLayout

We only have one player module. Thanks to the “Clone the repeated text elements” you will find in the XML Import Options, InDesign is going to duplicate our module as many times as needed:

xmlImportOptions

xmlResult

Et voilà !

I hope this article will help you avoiding common mistakes and get faster results. If you want to share other typical errors, feel free to do so into the comments.

If you want a XML Import training or consulting services for your publishing projects, contact us !

See you soon !

Leave a Reply

Your email address will not be published. Required fields are marked *