Hallo,
ich brauchte etwas Zeit um zu verstehen, was da abläuft. Das Ding mit den Node-Sets ist mir noch nicht klar, da muss ich noch mal nachschlagen. Xalan funktioniert bei mir nicht, exslt schon.
Dein Muster hat auf Anhieb geklappt, leider wurde das Problem nicht gelöst. Ich zeige jetzt zuerst, wie ich es gemacht habe und weiter unten, wie meine "Quelle" aussieht.
Zuerst benenne ich die einzelnen Spalten:
<xsl:variable name="cName" select="1"/>
<xsl:variable name="cMaster" select="3"/>
<xsl:variable name="cLang" select="12"/>
[...]
Dann:
<!-- 3. Schritt -->
<xsl:template match="table:table-row" mode="Adjusted">
<record>
<Name><xsl:value-of select="table:table-cell[$cName]/text:p"/></Name>
<Master><xsl:value-of select="table:table-cell[$cMaster]/text:p"/></Master>
<Sprache><xsl:value-of select="table:table-cell[$cLang]/text:p"/></Sprache>
[...]
</record>
</xsl:template>
Soweit erstmal, für deine Antwort vielen Dank im Voraus,
Gruss Joerg
Anhang:
Hier bereinigte Auszüge aus der "content.xml" meines ods-Files. Wichtig: In Spalte 12 wird die Sprache erwartet. So mal rein gefühlsmäßig: Kann es sein, dass in der Zeile #1 die beiden table:table-cell/ den Fehler verursachen?
Beispiel-Zeile #1: -----------------------------------------------------
<table:table-row>
<table:table-cell><text:p>strKunde 1291 de</text:p></table:table-cell>
<table:table-cell/>
<table:table-cell><text:p>1291</text:p></table:table-cell>
<table:table-cell table:number-columns-repeated="3"><text:p>0</text:p></table:table-cell>
<table:table-cell><text:p>12543</text:p></table:table-cell>
<table:table-cell/>
<table:table-cell><text:p>38</text:p></table:table-cell>
<table:table-cell><text:p>3.2.1</text:p></table:table-cell>
<table:table-cell><text:p>BOTH</text:p></table:table-cell>
<table:table-cell><text:p>DE</text:p></table:table-cell> <!-- Sprache -->
<table:table-cell><text:p>Willy.Wutz@example.de</text:p></table:table-cell>
<table:table-cell><text:p>Wutz 4.12.08</text:p></table:table-cell>
<table:table-cell><text:p>3.2.1</text:p></table:table-cell>
<table:table-cell><text:p>file-321</text:p></table:table-cell>
<table:table-cell><text:p>file-321b</text:p></table:table-cell>
<table:table-cell><text:p>url-to-321b</text:p></table:table-cell>
<table:table-cell><text:p>url-to-321</text:p></table:table-cell>
<table:table-cell/>
<table:table-cell table:number-columns-repeated="1004"/>
</table:table-row>
Dies wird daraus gemacht:
~~~xml
<record>
<Name>strKunde 1291 de</Name>
<Master>1291</Master>
<ClientId>BOTH</ClientId>
<Version>DE</Version>
<Bestellwege>Willy.Wutz@example.de</Bestellwege>
<Sprache>Wutz 19.05.09</Sprache>
<KeyAccounter>321</KeyAccounter>
<Release/>
<Uploaddateiname>url-to-321</Uploaddateiname>
</record>
So sollte es sein:
~~~xml
<record>
<Name>strKunde 1291 de</Name>
<Master>1291</Master>
<ClientId>38</ClientId>
<Version>3.2.1</Version>
<Bestellwege>BOTH</Bestellwege>
<Sprache>DE</Sprache>
<KeyAccounter>Willy.Wutz@example.de</KeyAccounter>
<Release>3.2.1</Release>
<Uploaddateiname>file-321</Uploaddateiname>
</record>
Beispiel-Zeile #2: -----------------------------------------------------
</table:table-row>
<table:table-row>
<table:table-cell><text:p>strKunde 13</text:p></table:table-cell>
<table:table-cell><text:p>26.05.2008</text:p></table:table-cell>
<table:table-cell><text:p>13</text:p></table:table-cell>
<table:table-cell><text:p>2643</text:p></table:table-cell>
<table:table-cell><text:p>2939</text:p></table:table-cell>
<table:table-cell><text:p>11896</text:p></table:table-cell>
<table:table-cell><text:p>6130</text:p></table:table-cell>
<table:table-cell><text:p>15209</text:p></table:table-cell>
<table:table-cell><text:p>38</text:p></table:table-cell>
<table:table-cell><text:p>4.3.2</text:p></table:table-cell>
<table:table-cell><text:p>BOTH</text:p></table:table-cell>
<table:table-cell><text:p>DE</text:p></table:table-cell> <!-- Sprache -->
<table:table-cell><text:p>Ulla.Trulla@example.de</text:p></table:table-cell>
<table:table-cell><text:p>Trulla 05.06.08</text:p></table:table-cell>
<table:table-cell><text:p>4.3.2</text:p></table:table-cell>
<table:table-cell><text:p>file-432</text:p></table:table-cell>
<table:table-cell><text:p>file-432b</text:p></table:table-cell>
<table:table-cell><text:p>url-to-432b</text:p></table:table-cell>
<table:table-cell><text:p>url-to-432</text:p></table:table-cell>
<table:table-cell><text:p>15210</text:p></table:table-cell>
<table:table-cell table:number-columns-repeated="2"/>
<table:table-cell table:number-columns-repeated="231"/>
<table:table-cell table:number-columns-repeated="2"/>
<table:table-cell table:number-columns-repeated="768"/>
</table:table-row>
Dies wird daraus (korrekt) gemacht:
~~~xml
<record>
<Name>strKunde 13</Name>
<Master>13</Master>
<ClientId>38</ClientId>
<Version>4.3.2</Version>
<Bestellwege>NET</Bestellwege>
<Sprache>DE</Sprache>
<KeyAccounter>Ulla.Trulla@example.de</KeyAccounter>
<Release>4.3.2</Release>
<Uploaddateiname>file-432</Uploaddateiname>
</record>