Announcement

Collapse
No announcement yet.

Nächstes Vorkommen vom Element an gleicher Stelle..

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nächstes Vorkommen vom Element an gleicher Stelle..

    Hallo Zusammen,

    ich versuche mich gerade daran, eine OOXML Tabelle in HTML umzusetzen. Ich bekommen die colspans gut umgesetzt, jetzt will ich die rowspans umsetzen..
    Dabei ist mein Hauptproblem, wie ich den nächsten w:vMerge in der gleichen Spalte auswähle?

    Mein Template sieht wie folgt aus:

    Code:
      <xsl:template match="w:tc">
        <xsl:choose>
          <xsl:when test="./w:tcPr/w:vMerge and not(./w:tcPr/w:vMerge/@w:val)">
          </xsl:when>
          <xsl:otherwise>
            <xsl:element name="td">
              <xsl:if test="./w:tcPr/w:vMerge/@w:val= 'restart'">
                <xsl:attribute name="rowspan"></xsl:attribute>
              </xsl:if>
              <xsl:if test="./w:tcPr/w:gridSpan">
                <xsl:attribute name="colspan">
                  <xsl:value-of select="./w:tcPr/w:gridSpan/@w:val"/>
                </xsl:attribute>
              </xsl:if>
              <xsl:apply-templates />
            </xsl:element>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>


    Code:
              <w:tbl>
                <w:tblPr>
                  <w:tblStyle w:val="Tabellengitternetz"/>
                  <w:tblW w:w="0" w:type="auto"/>
                  <w:tblLook w:val="04A0"/>
                </w:tblPr>
                <w:tblGrid>
                  <w:gridCol w:w="2303"/>
                  <w:gridCol w:w="2303"/>
                  <w:gridCol w:w="2303"/>
                  <w:gridCol w:w="2303"/>
                </w:tblGrid>
                <w:tr w:rsidR="00960993" w:rsidTr="00960993">
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00960993" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>a</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00960993" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>b</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00960993" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>c</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00960993" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>d</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                </w:tr>
                <w:tr w:rsidR="00190741" w:rsidTr="004159B5">
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="4606" w:type="dxa"/>
                      <w:gridSpan w:val="2"/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>e</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>f</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                      <w:vMerge w:val="restart"/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>g</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                </w:tr>
                <w:tr w:rsidR="00190741" w:rsidTr="00960993">
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>h</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>i</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>j</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                      <w:vMerge/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00190741"/>
                  </w:tc>
                </w:tr>
                <w:tr w:rsidR="00190741" w:rsidTr="00BA4454">
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>k</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="4606" w:type="dxa"/>
                      <w:gridSpan w:val="2"/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00B24013">
                      <w:r>
                        <w:t>l</w:t>
                      </w:r>
                    </w:p>
                  </w:tc>
                  <w:tc>
                    <w:tcPr>
                      <w:tcW w:w="2303" w:type="dxa"/>
                      <w:vMerge/>
                    </w:tcPr>
                    <w:p w:rsidR="00190741" w:rsidRDefault="00190741"/>
                  </w:tc>
                </w:tr>
              </w:tbl>
    Danke für eure Kommentare...

    Gruß, Jack the Web
Working...
X