I have a few questions about the InDesign XML import.

So, when I import my XML file, I get a structure which I can insert into the document. I would like to customize the way that InDesign puts the XML structure into the document. To give you a little background information: I write the content for the inDesign-document in Markdown, export that as html and edit a few lines in the resulting html file to get a valid xml file (I know that one could question the efficiency of this workflow, but please don't). Thus, I have many <p>, <ul>, <li>, <h1> - <h6> and other html-tags in the xml file that I import in InDesign.

So, what is the best way to tell InDesign how to deal with these elements? A few examples of what I want to customize:

  • InDesign inserts consecutive <li>-elements as individual paragraphs each. I would prefer all consecutive list-elements to be inserted as one paragraph with soft wraps between each element.
  • I would like to be able to tell inDesign to import certain Elements (respectively xml-tags) not as paragraphs, but as table cells or 1x1 tables.
  • I want InDesign to insert the content of <pre> and <code> elements as one paragraph with soft wraps.

Is there a way to do this (as well as similar customizations)? If there are multiple options, it would be great if you could tell me the pros and cons to them!

  • 1
    I know I've recommended IDML in a previous answer, and I think it may be worth exploring for you here as well. You don't have to read the 500 page specification. If you open a fresh InDesign document, and create and style just one sample of each element type you intend to use, and then File > Export and choose Save as type > InDesign Markup (IDML), you can get see the IDML elements required to accomplish the formatting you want.
    – apex
    Commented Sep 26, 2014 at 21:19
  • Thanks, I will look into it! Can you recommend anything that I could read to get a general understanding of what IDML is, what purpose it caters and how I can use it? Preferably something smaller than 500 pages? °ω°
    – MoritzLost
    Commented Sep 27, 2014 at 21:31
  • I don't know of any good general overviews, but a really broad description is XML for InDesign (IDML stands for InDesign Markup Language). If you've worked with XML before, the syntax is the same, but IDML just has specific element names to achieve specific results in the InDesign document.
    – apex
    Commented Sep 28, 2014 at 3:09
  • 1
    To get a basic idea of what process I'm recommending, you can look at this answer on SO. Also look at the sample Pastebin and screenshot to see "before and after" (bottom of the answer). Admittedly, the intended use on that answer is probably not at all what you want, but it is the same process conceptually.
    – apex
    Commented Sep 28, 2014 at 3:13
  • Thanks! Looks complicated enough, I'll look into it once I have the time °ω°
    – MoritzLost
    Commented Sep 28, 2014 at 13:50


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.