0

All,

I'm having a hell of a time getting this to work. I have a very basic XML structure:

<root>
    <item>
        <header>NEW HEADER</header>
        <body>NEW BODY - Sed auctor justo et erat rutrum, nec molestie neque placerat. Quisque efficitur condimentum velit nec volutpat. Nunc sed magna vel mauris convallis sodales</body>
        <footer>NEW - Footer: Donec in nibh risus. Sed placerat felis non pellentesque placerat. In non risus a elit malesuada consectetur.</footer>
    </item>
    <item>
        <header>NEW HEADER 2</header>
        <body>NEW BODY - Sed auctor justo et erat rutrum, nec molestie neque placerat. Quisque efficitur condimentum velit nec volutpat. Nunc sed magna vel mauris convallis sodales</body>
        <footer>NEW - Footer: Donec in nibh risus. Sed placerat felis non pellentesque placerat. In non risus a elit malesuada consectetur.</footer>
    </item>
</root>

I've created an InDesign template with tagged text-area placeholders. What I want to achieve is create a new page for each <item> tag and populate the data appropriately. When I load my XML, it loads each <item> but it doesn't generate a new page for each one.

Any help would be appreciated.

gin93r
  • 1,551
  • 4
  • 21
  • 39

2 Answers2

2

that's because you need to understand some basic rules. Number one is that xml is just about text within InDesign. In your case, your template has to dispose from a generic set of tags and a page break character. You will ask InDesign to duplicate that set and character at every occurence of the repeated incoming node. I wrote a blog post that talk about all those peculiarities. Especially for rookies ;) : http://www.ozalto.com/en/5-errors-you-will-do-with-indesign-xml/

Loic
  • 2,173
  • 10
  • 13
  • Thanks. I feel like I came to the conclusion that they dropped the ball with regards to XML. It could have been so much more. Using parent nodes as pages, and tagging text blocks to child nodes. It could have been so great. But it's not. Even trying to use javascript to achieve what I wanted was cumbersome. Oh well. – gin93r Mar 23 '16 at 16:57
  • Well there are plugins such as easycatalog that can smooth XML data injection. – Loic Mar 23 '16 at 17:53
0

You'll want to take a look at the "Merge Mode" section of Adobe's Importing XML documentation here: https://helpx.adobe.com/indesign/using/importing-xml.html

From that page:

Merge mode not only makes automated layout possible, it provides more advanced import options, including the ability to filter incoming text and clone elements for repeating data.

it sounds like you need the "clone elements" feature.

To get new page for each <item> put a page break at the end of <item> Then make sure to set a "Primary Text Frame" on your master page. https://helpx.adobe.com/indesign/using/whats-new-cs6.html#id_16192 With this set, InDesign will simply create a new page as needed.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
user1754036
  • 396
  • 1
  • 6
  • Thanks for the reply. I did try that. The issue is that it takes the repeated nodes (``) and just adds them to that one primary text frame. Which, isn't exactly what I'm looking to do. What I want, is to be able to maybe tag a page as "item" and then layout other frames tagged with its child nodes. This doesn't appear to be doable. – gin93r Mar 24 '16 at 13:48
  • If you look at my previous blog post link, you should see that to have one page per item, your preliminary layout need to host a page break. The clone elements option that user1754036 evoked is indeed the way InDesign will repeat that page break from node to node. – Loic Mar 30 '16 at 10:26