Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing XML into InDesign

I am trying to create a template for XML data using InDesign. Basic Structure is:

<page>
<section1>
<product><title></title></product>
<product><title></title></product>
...
</section1>
<section2>
....

Each section has a variable number of products. Each template will be created with the correct number of sections (although repeating sections with child products would also work).

Is this scenario supported using the Import XML functionality? Can anyone point to a tutorial showing how to set this up?

I have tried some examples, but cannot get InDesign to even repeat the products after adding placeholders and re-importing the file as all tutorials suggest..

Thanks

like image 384
Brian Chance Avatar asked Jan 28 '13 23:01

Brian Chance


People also ask

How do I import XML into placeholders in InDesign?

You must use the Merge Content option to import XML into placeholders (or to replace existing content in your document). When merging content, InDesign replaces identically tagged and structured elements in your document with the imported XML elements.

How do I open an XML file in InDesign?

Select Append Content, and then click Open. To link the XML content to the original XML file, select Create Link. InDesign will list the XML file in the Links panel and display a yellow alert triangle in the panel if the XML file changes.

How do I delete content from an XML file in InDesign?

Delete elements, frames and content that do not match imported XML: Deletes all content in the new document that is not found in the XML file. Click on ‘OK’ in ‘XML Import Options’ to merge the new InDesign document with the XML elements. You may notice that the BRAND and CAR_MODEL elements have been separated:

How does InDesign work with imported content?

When you merge imported content, InDesign compares the incoming XML with the structure and names of elements already in your document. If the elements match, imported data replaces existing document content, and is merged into correctly tagged frames (or placeholders) in the layout.


2 Answers

A solution by batch processing (a lot of articles)

... The only way that I can use today (2013) is this (semi-automatic) procedure:

  1. [manual, prepare] Check my InDesign "template" file, that will be used as "importer": styles with legible names must by defined. They are all visible (listed) in a HTML+CSS exporting.
  2. [manual, prepare] Adapt a XSLT to convert convert your XML files to XHTML ones, expressing all relevant styles with the attribute class and consistent (with item 1) class names;
  3. [automatic, batch processing] Convert automatically all XML to XHTML by the XSLT;
  4. [automatic, batch processing] Convert automatically all XHTML files to DOC, using Python OpenDocument Converter.
  5. [InDesign assisted, final processing] Import each DOC from a "template" (item 1) file clone at InDesign. The classes (item 2) will be automatically transformed by InDesign styles.

This procedure is better than IDML because use directaly the XHTML as content source for InDesign. It is not perfect for all applications, but avoids use of non-standard conversion by IDML, avoid to learn IDML, avoid IDML limitations, and avoids risks of IDML bugs... So, I think is faster than try and try IDML procedures.


Another procedure — better, because it allows to express things like footnotes — is to prepare a direct convertion from XML to MS-Word, by a XSLT that transforms XML into DOCX or RFT... Do you have a link or clue for this kind of procedure?


MANIFEST

Adobe products are "closed" for universal standards (!) importation, like to import XHTML.

How to PROTEST against Adobe?!

The biggest problem arises when we have many files...

like image 107
5 revs Avatar answered Sep 20 '22 13:09

5 revs


Once you've converted your XML to HTML or DocBook XML, you can use Pandoc to get it into InDesign.

Pandoc has lots of importers (for example from HTML or DocBook XML) and can now export to Adobe InCopy's ICML format. The resulting file can then be placed in InDesign like any other external dependency.

pandoc --standalone -t ICML -o output.icml input.html
like image 34
mb21 Avatar answered Sep 18 '22 13:09

mb21