Folgendes Problem:
Ich möchte von InDesign CS2 eine Tabelle mittels XML exportieren. Diese XML-Tabelle soll anschließend via XSLT in eine normale XHTML Tabelle umgewandelt werden. InDesign liefert mir folgendes XML:
Mein XSLT sieht momentan wie folgt aus:
Alles anzeigen
Scheinbar hab ich da etwas noch nicht ganz begriffen - da die Attribute jeweils nach der Transformation leer dastehen.
Ich möchte von InDesign CS2 eine Tabelle mittels XML exportieren. Diese XML-Tabelle soll anschließend via XSLT in eine normale XHTML Tabelle umgewandelt werden. InDesign liefert mir folgendes XML:
Quellcode
- <Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:trows="8" aid:tcols="8">
- <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="60.11122047244095">1</Cell>
- <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="60.11122047244095">2</Cell>
- <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="60.11122047244095">3</Cell>
- <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="60.11122047244095">4</Cell>
- <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="60.11122047244095">5</Cell>
- <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="60.11122047244095">6</Cell>
- <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="60.11122047244095">7</Cell>
- <Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="60.11122047244095">8</Cell>
Mein XSLT sieht momentan wie folgt aus:
Quellcode
- <xsl:template match="Table" aid:table="table">
- <table border="0" cellpadding="0" cellspacing="1" width="100%">
- <xsl:apply-templates/>
- </table>
- </xsl:template>
- <xsl:template match="Cell" aid:table="cell">
- <tr>
- <xsl:apply-templates/>
- </tr>
- </xsl:template>
- <xsl:template match="Cell">
- <xsl:element name="td">
- <xsl:attribute name="colspan"><xsl:value-of select="@aid:ccols"/></xsl:attribute>
- <xsl:attribute name="colwidth"><xsl:value-of select="@aid:ccolwidth"/></xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
Scheinbar hab ich da etwas noch nicht ganz begriffen - da die Attribute jeweils nach der Transformation leer dastehen.