How to choose between XML Import and Datamerge ?
During an InDesign User Group Meeting in Paris, a spectator asked me this simple question : “How to choose between XML Import and Datamerge ?”. A vast topic I tried to cover in a short time. I take this opportunity to speak further and hopefully provide elements of a response to make your final choice.
It’s all about your layout project, what you have to accomplish and how much you need to keep track of your data. You must rely on you customer ability to provide a data file of a certain format. You don’t handwrite XML. You get the output from a dedicated tool (SQL Database, FileMaker…).
If your customer doesn’t have such tool and refuse to invest, forget XML. Other clients only swear by Excel Tables overwhelmed with formulas, filters and so many fills that lead to randomly extractable CSV format.
Forget the XML export from Excel. If you are lucky, you will get a functional CSV file. Prefer the Tab Delimited Text File format, you will avoid may issues. And if you are really into XML, feel free to use our CSV2XML script in our downloads section. As you see, you have many options here and yet the question is still hanging out there : How to choose between XML Import and Datamerge ?
BusinessCards, Mailing ?
Choose Datamerge! It’s so easy to set. A few tags et voilà! In just seconds, you get all your 2500 entries. A few minutes and a PDF Export later, it’s done ! Datamerge fits well with Business Cards, mailing, letterheads.
Tables, directories ?
Datamerge is not intented to generate tables and directories. If you need to do so, feel free to use our specific scripts such as CSV2Table or InlineMerge. if still not adequate, maybe it’s time to use XML.
Catalogs, datasheets ?
Say bye to datamerge unless you are using dedicated plug-ins able to extend this feature. Start using XML.
Setting a XML template is generally more time-consuming than preparing Datamerge documents. Although both features are based on tagging, they are really different. To get nice continuous flows throughout several pages, you have to use a particular logic based on threaded frames.
Eventually, it’s likely that the XML structure you received from the client will not match your requirements. You have only two options left :
- Harass the IT guy in charge of the XML Export so he fits your needs (good luck with that 🙂 )
- Use the XSLT language to make the XML compliant to your own structure
Yes, that’s complex but hey, so is your template…:D
If data updates is critical in your project, forget datamerge right away. This technology is one way only. Once it’s done, you get a document with all your records nicely generated. However InDesign has no clue on what’s in it. In other words, if you change the CSV content, InDesign is unable to locate the data that needs to be updated. All you have to do is start over.
However, the XML import keeps a connection between the data and where it’s being used. In case you choose to import the XML file as a link, InDesign will warn you in the Links palette. Then a simple click on “Update the link” will reload the XML smoothly. Take care not to idealize XML update though. If the structure of your XML has been changed, you probably won’t have enough fingers to count damages. Keep this feature for changes that only affect contents.
Datamerge is really a powerful tool that will fit well for simple structures. If your layout is complex or requires conditional parameters ( if X then Y ), then choose a combination of XML and XSLT or a plug-in designed for structured data layout.
The inherent limitations of these technologies can be overriden thanks to scripting. Now I am testing an automated layout based on a combination of library assets and scripting. I still use XML to store my customer data. However I am not calling InDesign XML Engine. I am parsing the XML file and automatically inject data where it has to be. What’s the point of redesigning an injection process when InDesign can do it by its own ? I save so many time preparing my document !
Ok, I hope this post will help you to make your final choice between XML Import and Datamerge and good luck to all of you ! If you feel like you need more custom advices, feel free to contact us !