0

I am looking to populate an InDesign document with multiple pages from an XML file, with one textbox per-page and a page break after each page's text.

This is what the XML file looks like:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root>
    <all-pages>
        <page>Text for page one</page>
        <page>Text for page two</page>
        <!-- [and so on...] -->
    </all-pages>
</Root>

The output I'd like to achieve is illustrated below. This was created by clicking and dragging, but I have several pages (412) and so am looking for a way to automate this.

current InDesign setup

I've read several guides but nothing seems to deal with a simple test case like this. Any help would be very much appreciated, thank you!

3
  • If you already have (or insert) a page break after each page of text, then why not connect the text frames? Then you wouldn't need to look any further.
    – Jongware
    Dec 16, 2016 at 14:55
  • How would I programatically add page break to each page of text? Dec 16, 2016 at 15:20
  • Ah sorry, you still need to add one. Put it in the style of your top element.
    – Jongware
    Dec 16, 2016 at 16:03

1 Answer 1

1

You don't need to program anything. This behavior can be easily obtained with a bit of adjustment to your layout and tagging plus setting "Clone Repeating Text Elements".

Basically you need this in your InDesign document:

<allPages>
  <pageSet>
    <page/>[[here stands the page break in the layout]]
  </pageSet>
</allPages>

Then your input XML can simply be:

<allPages>
  <pageSet>
    <page/>
  </pageSet>

  <pageSet>
    <page/>
  </pageSet>

  <pageSet>
    <page/>
  </pageSet>
  (etc.)
</allPages>

You have to use an enclosing node so the page break character is part of the cloning process.

Alternatively, if all pages have identically structured contents (i.e., start with the same paragraph style) you can just set the paragraph style of the first contents of any page to start on a new page (Paragraph Styles > Keep Options > Start Paragraph: On Next Page). Don't forget to map the tag to the paragraph style (XML structure pane menu > Map Tags to Styles). That way when flowing any contents that uses the style will be pushed to the next page.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.