使用Cell标签将XML导入InDesign表格的异常问题求助
I’ve tackled similar InDesign XML import and XSLT conversion headaches before, and your problem almost certainly stems from mismatched structure expectations between your transformed XML and InDesign’s table import rules. Let’s break down the likely causes and fixes:
Common Root Causes
- Missing Row Nodes: InDesign expects a strict hierarchy for tables:
<Table><Row><Cell>...</Cell></Row></Table>. Your current structure skips the<Row>wrapper, so InDesign has no idea where to place cells properly—hence the messy header overlap. - Incorrect Import Binding/Options: If your
<Table>element isn’t bound to the existing table frame in InDesign, or you’re using the default "Append" setting instead of "Replace" during import, new content will pile onto existing cells instead of replacing them. - WordML to XML Mapping Gaps: WordML uses
<w:tbl><w:tr><w:tc>for tables/rows/cells. If your XSLT isn’t correctly mapping these to InDesign’s required<Table><Row><Cell>structure, you’ll end up with invalid XML that InDesign can’t parse properly.
Step-by-Step Fixes
Adjust Your XSLT to Generate Valid Table Hierarchy
Ensure your transformation outputs the full row-cell wrapper that InDesign needs. Here’s a simplified example of how to map WordML to your target XML:<!-- Match WordML tables --> <xsl:template match="w:tbl"> <Table> <xsl:apply-templates select="w:tr"/> </Table> </xsl:template> <!-- Map WordML rows to InDesign rows --> <xsl:template match="w:tr"> <Row> <xsl:apply-templates select="w:tc"/> </Row> </xsl:template> <!-- Map WordML cells to InDesign cells --> <xsl:template match="w:tc"> <Cell> <xsl:apply-templates select="w:p"/> </Cell> </xsl:template>This ensures every cell is wrapped in a
<Row>, which InDesign uses to place content correctly.Configure InDesign XML Import Settings
- Open your InDesign document and go to
Window > Utilities > Structureto access the XML panel. - Bind your
<Table>element to the existing table frame: drag the<Table>node from the XML panel directly onto your table in the document. - When importing XML, in the import dialog, under Existing Content, select Replace instead of Append. This tells InDesign to overwrite existing table content rather than adding to it.
- Open your InDesign document and go to
Test with a Clean Empty Table
To rule out issues with existing table formatting, create a blank InDesign table, bind the<Table>element to it, then import your transformed XML. If this works, the problem was likely tied to residual formatting or incorrect binding on your original table.
If you’re still seeing issues, sharing a snippet of your current XSLT and a screenshot of your InDesign Structure panel would help narrow things down further.
内容的提问来源于stack exchange,提问作者Freezebaby

