0

I have a workflow where I would like to modify content and import the new content into the same Indesign layout. I thought the following would work:

  1. Export XML from Indesign
  2. Modify XML
  3. Import XML into indesign
  4. Repeat at 2 for each update

However, the xml exported by Indesign is a single line of xml. When I reformat in webstorm or any editor to easily modify the document, the import of that xml ruins my layout (I assume because I changed some special or hidden characters at the format) even if I manually remove tabs and newline characters.

Is there any other way to make this workflow work? The only ways I can see are:

  • Must edit content directly in indesign document
  • Use XSLT somehow?
  • An editor that displays xml pretty but saves without any changes in whitespace (i.e. will display your xml pretty but of course, you can't edit it)
  • use <?whitespace-handling use-tags?> in the xml but didn't work for me see (http://www.justskins.com/forums/xml-import-whitespace-and-78216.html)
jpmorris
  • 882
  • 2
  • 10
  • 22

2 Answers2

1

Problem is that InDesign manages XML files are regular text files. So any indentation spaces are considered as spaces characters unless you ask InDesign to ignore them. Try checking "Do Not Import Contents Of Whitespace-Only Elements".

Loic
  • 2,173
  • 10
  • 13
  • Unfortunately any 'ignore whitespace' settings don't help. I think the reason is because it's 'whitespace only *elements*' But my whitespace aren't inside xml elements they are hidden characters to the document (tabs and newlines etc) – jpmorris Jun 05 '18 at 14:04
0

So the current solution (still looking for better one) seems to be:

  1. Export xml from indesign doc
  2. Reformat to pretty xml in your favorite editor
  3. add the following header:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?whitespace-handling use-tags?> <Root xmlns:aid="http://ns.adobe.com/AdobeInDesign/3.0/"> ... </Root>

  4. Use your editor software to remove all tabs (via un-indent) and remove all newlines via '\n' regex find and replace

  5. Import into indesign
  6. Work off your 'pretty version' to make modifications and follow steps for each iteration.
jpmorris
  • 882
  • 2
  • 10
  • 22