0

I am writing an XSLT transform from WordML into XML, formatted for import into InDesign. But I'm having trouble with getting Table content (not CALS tables) to flow into the InDesign document as expected. When I use the <Table><Cell><para>some content</para></Cell></Table> structure in my XML, the XML cells are appended to the beginning of the Table (with some strange content overlap), rather than replacing the existing Cells in the InDesign document. But when I don't include <Cell> tags in my XML or InDesign document, the content imports in just fine.

I would much prefer being able to use Cell tags in my XML, as that is more straightforward in the case that there is more than one element inside a particular cell. I'm looking for suggestions on how to get the first structure to work.

InDesign document Table tag structure (each cell is a row/column):

Table
   Cell
      H1
   Cell
      H4
   Cell
      para

Corresponding XML structure (the line breaks are particular, to avoid unwanted line breaks in imported content):

<Table><Cell><H1>Heading</H1></Cell>
   <Cell><H4>Sub-Heading</H4></Cell>
   <Cell><para>Some content goes here.</para></Cell>
</Table>

Unexpected results, in InDesign document tag structure:

Table
   Cell
      H1 (imported content)
   Cell
      H4 (imported content)
      H1 (document placeholder content)
   Cell
      para (imported content)
      H1 (document placeholder content)
   Cell
      H4 (document placeholder content)
   Cell
      para (document placeholder content)

InDesign document tag structure that, surprisingly, does work, but is not ideal:

Table
  H1
  H4
  para

Corresponding XML code:

<Table><H1>Heading</H1>
  <H4>Sub-Heading</H4>
  <para>Some content goes here.</para>
</Table>
  • 2
    InDesign XML syntax is peculiar and requires a lot of parameters such as a specific architecture, attributes and possibly namespaced attributes. An easy way to get a clear idea of the output is to draw a table inside InDesign, tag it then export to XML. – Loic Apr 30 '18 at 11:16

1 Answers1

0

It looks like what I was missing is the InDesign xmlns:aid="ns.adobe.com/AdobeInDesign/4.0" namespace and associated tags.

<Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:trows="2" aid:tcols="1">
    <Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="442.7142857142858" >
        Some cell content
    </Cell>
</Table>