Stil hinzufügen, um excel-Datei erstellt mit xml mit Hilfe von xslt
Muss ich Einrücken von text in bestimmten Zellen.Die Zellen sind xml-Elemente, die Kinder haben.
Meine XML ist:
<rows>
<row id="FOLDER1">
<cell image="blank.gif">Folder 1</cell>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell sum="1">$23</cell>
<row id="FOLDER2">
<cell image="blank.gif">Folder 2</cell>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell sum="2">$11</cell>
<row id="FOLDER3">
<cell image="blank.gif">Folder 3</cell>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell sum="3">$44</cell>
<row id="pro1">
<cell image="blank.gif">Product 1</cell>
<cell>324234</cell>
<cell>3.00</cell>
<cell>Kilo</cell>
<cell>1.00</cell>
<cell>No</cell>
<cell>euro 33.33</cell>
<cell>euro 33.33</cell>
</row>
<row id="pro2">
<cell image="blank.gif">Product 2</cell>
<cell>4354354</cell>
<cell>1.00</cell>
<cell>Kilo</cell>
<cell >0.50</cell>
<cell>No</cell>
<cell>euro 2.53</cell>
<cell>euro 1.26</cell>
</row>
</row>
<row id="pro3">
<cell image="blank.gif">Product 3</cell>
<cell>435436</cell>
<cell>10.00</cell>
<cell>Kilo</cell>
<cell>Yes</cell>
<cell>euro 0.36</cell>
<cell>euro 3.60</cell>
</row>
<row id="pro4">
<cell image="blank.gif">Product 4</cell>
<cell>435435</cell>
<cell>3.28</cell>
<cell>Kilo</cell>
<cell>1.00</cell>
<cell>No</cell>
<cell>euro 17.38</cell>
<cell>euro 17.38</cell>
</row>
</row>
</row>
<row id="FOLDER1">
<cell image="blank.gif">Folder 4</cell>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell/>
<cell sum="1">$23</cell>
</row>
Mein XSLT ist:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?mso-application progid="Excel.Sheet"?>
<xsl:stylesheet version="1.0"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<xsl:param name="header1">Header1</xsl:param>
<xsl:param name="header2">Header2</xsl:param>
<xsl:param name="header3">Header3</xsl:param>
<xsl:param name="header4">Header4</xsl:param>
<xsl:param name="header5">Header5</xsl:param>
<xsl:param name="header6">Header6</xsl:param>
<xsl:param name="header7">Header7</xsl:param>
<xsl:param name="header8">Header8</xsl:param>
<xsl:template match="rows">
<Workbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom" />
<Borders />
<Font />
<Interior />
<NumberFormat />
<Protection />
</Style>
<Style ss:ID="s21">
<Font ss:Size="22" ss:Bold="1" />
</Style>
<Style ss:ID="columnheaders">
<Font ss:Size="12" ss:Bold="1" />
</Style>
<Style ss:ID="s22">
<Font ss:Size="14" ss:Bold="1" />
</Style>
<Style ss:ID="s23">
<Font ss:Size="10" />
</Style>
<Style ss:ID="s24">
<Font ss:Size="10" ss:Bold="1" />
</Style>
</Styles>
<Worksheet ss:Name="data">
<Table>
<Column ss:AutoFitWidth="0" ss:Width="300" />
<Column ss:AutoFitWidth="0" ss:Width="95" />
<Column ss:AutoFitWidth="0" ss:Width="95" />
<Column ss:AutoFitWidth="0" ss:Width="175" />
<Column ss:AutoFitWidth="0" ss:Width="186" />
<Column ss:AutoFitWidth="0" ss:Width="185" />
<Column ss:AutoFitWidth="0" ss:Width="113" />
<Column ss:AutoFitWidth="0" ss:Width="133" />
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">
<xsl:value-of select="$header1"/>
</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">
<xsl:value-of select="$header2"/>
</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">
<xsl:value-of select="$header3"/>
</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">
<xsl:value-of select="$header4"/>
</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">
<xsl:value-of select="$header5"/>
</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">
<xsl:value-of select="$header6"/>
</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">
<xsl:value-of select="$header7"/>
</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">
<xsl:value-of select="$header8"/>
</Data>
</Cell>
</Row>
<xsl:apply-templates select="row"/>
</Table>
</Worksheet>
</Workbook>
</xsl:template>
<xsl:template match="row">
<xsl:variable name="rowID">
<xsl:number level="any" format="1"/>
</xsl:variable>
<Row ss:AutoFitHeight="0" ss:Height="18">
<xsl:for-each select="cell">
<xsl:variable name="colID">
<xsl:number value="position()" format="A"/>
</xsl:variable>
<Cell ss:StyleID="s23">
<Data ss:Type="String">
<xsl:value-of select="translate(.,'?','€')"/>
</Data>
</Cell>
</xsl:for-each>
</Row>
<xsl:apply-templates select="row"/>
</xsl:template>
</xsl:stylesheet>
Meine Ausgabe generiert aus den Transformationen:
<?xml version="1.0" encoding="UTF-8"?>
<Workbook xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s21">
<Font ss:Size="22" ss:Bold="1"/>
</Style>
<Style ss:ID="columnheaders">
<Font ss:Size="12" ss:Bold="1"/>
</Style>
<Style ss:ID="s22">
<Font ss:Size="14" ss:Bold="1"/>
</Style>
<Style ss:ID="s23">
<Font ss:Size="10"/>
</Style>
<Style ss:ID="s24">
<Font ss:Size="10" ss:Bold="1"/>
</Style>
</Styles>
<Worksheet ss:Name="data">
<Table>
<Column ss:AutoFitWidth="0" ss:Width="300"/>
<Column ss:AutoFitWidth="0" ss:Width="95"/>
<Column ss:AutoFitWidth="0" ss:Width="95"/>
<Column ss:AutoFitWidth="0" ss:Width="175"/>
<Column ss:AutoFitWidth="0" ss:Width="186"/>
<Column ss:AutoFitWidth="0" ss:Width="185"/>
<Column ss:AutoFitWidth="0" ss:Width="113"/>
<Column ss:AutoFitWidth="0" ss:Width="133"/>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header1</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header2</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header3</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header4</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header5</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header6</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header7</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header8</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Folder 1</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">$23</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Folder 2</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">$11</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Folder 3</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">$44</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Product 1</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">324234</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">3.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Kilo</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">1.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">No</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 33.33</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 33.33</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Product 2</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">4354354</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">1.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Kilo</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">0.50</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">No</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 2.53</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 1.26</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Product 3</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">435436</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">10.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Kilo</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Yes</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 0.36</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 3.60</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Product 4</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">435435</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">3.28</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Kilo</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">1.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">No</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 17.38</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 17.38</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Folder 4</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">$23</Data>
</Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
Und hier, wie es aussieht, wird beim öffnen in excel:
Muss ich Einrücken der Zellen rekursiv und auch um zu überprüfen, ob die Zeilen haben Kinder, wenn Sie benötige ich, um Sie Kursiv,wenn nicht nur Sie zu verlassen unediert.
Beispiel, wie es Aussehen sollte:
*Folder1*
*Folder2*
*Folder3*
Product1
Product2
Product3
Product4
Folder4
Hier ist das xml, das ich bekommen sollte:
<?xml version="1.0" encoding="UTF-8"?>
<Workbook xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s21">
<Font ss:Size="22" ss:Bold="1"/>
</Style>
<Style ss:ID="columnheaders">
<Font ss:Size="12" ss:Bold="1"/>
</Style>
<Style ss:ID="s22">
<Font ss:Size="14" ss:Bold="1"/>
</Style>
<Style ss:ID="s23">
<Font ss:Size="10"/>
</Style>
<Style ss:ID="s24">
<Font ss:Size="10" ss:Bold="1"/>
</Style>
<Style ss:ID="parent1">
<Font ss:Size="10" ss:Italic="1"/>
</Style>
<Style ss:ID="parent2">
<Alignment ss:Indent="1"/>
<Font ss:Size="10" ss:Italic="1"/>
</Style>
<Style ss:ID="parent3">
<Alignment ss:Indent="2"/>
<Font ss:Size="10" ss:Italic="1"/>
</Style>
<Style ss:ID="children3">
<Alignment ss:Indent="3"/>
<Font ss:Size="10"/>
</Style>
<Style ss:ID="children2">
<Alignment ss:Indent="2"/>
<Font ss:Size="10"/>
</Style>
</Styles>
<Worksheet ss:Name="data">
<Table>
<Column ss:AutoFitWidth="0" ss:Width="300"/>
<Column ss:AutoFitWidth="0" ss:Width="95"/>
<Column ss:AutoFitWidth="0" ss:Width="95"/>
<Column ss:AutoFitWidth="0" ss:Width="175"/>
<Column ss:AutoFitWidth="0" ss:Width="186"/>
<Column ss:AutoFitWidth="0" ss:Width="185"/>
<Column ss:AutoFitWidth="0" ss:Width="113"/>
<Column ss:AutoFitWidth="0" ss:Width="133"/>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header1</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header2</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header3</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header4</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header5</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header6</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header7</Data>
</Cell>
<Cell ss:StyleID="columnheaders">
<Data ss:Type="String">Header8</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="parent1">
<Data ss:Type="String">Folder 1</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">$23</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="parent2">
<Data ss:Type="String">Folder 2</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">$11</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="parent3">
<Data ss:Type="String">Folder 3</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">$44</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="children3">
<Data ss:Type="String">Product 1</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">324234</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">3.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Kilo</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">1.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">No</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 33.33</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 33.33</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="children3">
<Data ss:Type="String">Product 2</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">4354354</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">1.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Kilo</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">0.50</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">No</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 2.53</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 1.26</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="children2">
<Data ss:Type="String">Product 3</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">435436</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">10.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Kilo</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Yes</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 0.36</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 3.60</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="children2">
<Data ss:Type="String">Product 4</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">435435</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">3.28</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">Kilo</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">1.00</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">No</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 17.38</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">euro 17.38</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:StyleID="s23">
<Data ss:Type="String">Folder 4</Data>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String"/>
</Cell>
<Cell ss:StyleID="s23">
<Data ss:Type="String">$23</Data>
</Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
Screenshot mit der xml sollte ich bekommen:
Können Sie eine Liste der erwarteten Ausgabe als XML?
Ich habe bearbeitet meine Antwort und fügte das erwartete xml-Ausgabe.Sie können öffnen Sie die xml-Daten mit excel, um zu sehen, grafisch, wie es aussieht.
Welche version von Excel?
Ich öffnete Ihr "erwartet" xml in Excel 2003, und für alle Inhalte erschien in der ersten Zelle. Es sei denn, Sie sind mit einer anderen version von Excel, möchten Sie vielleicht überprüfen Sie Ihre xml für die Richtigkeit.
Ich benutze Excel 2007 und hier sieht es gut,ich habe ein screenshot, wie die hier angezeigt wird.
Ich habe bearbeitet meine Antwort und fügte das erwartete xml-Ausgabe.Sie können öffnen Sie die xml-Daten mit excel, um zu sehen, grafisch, wie es aussieht.
Welche version von Excel?
Ich öffnete Ihr "erwartet" xml in Excel 2003, und für alle Inhalte erschien in der ersten Zelle. Es sei denn, Sie sind mit einer anderen version von Excel, möchten Sie vielleicht überprüfen Sie Ihre xml für die Richtigkeit.
Ich benutze Excel 2007 und hier sieht es gut,ich habe ein screenshot, wie die hier angezeigt wird.
InformationsquelleAutor Aleks | 2012-11-08
Du musst angemeldet sein, um einen Kommentar abzugeben.
Für den Einzug ist, würde ich beginnen, indem Sie einen neuen parameter, um zu halten die Größe der Einbuchtung, die Sie benötigen für jede Ebene. In diesem Fall bin ich mit vier Räumen.
Dann innerhalb der Vorlage entspricht, die Zeile - element haben, können Sie einen parameter, speichert die Größe des aktuellen Einrückung zu verwenden, wird zunächst standardmäßig ein leerer string ist (ich.e keine Einrückung).
Wenn Sie rekursiv aufrufen, Ihre Zeilen-Vorlage, fügen Sie einfach auf die paramterised Einzug Betrag auf die aktuellen Einzüge, um es zu vergrössern
Dann ist es einfach ein Fall von bestens den Einzug parameter für die erste Zelle
Für die Kursiv sind, können Sie einfach definieren Sie einen neuen Stil
Dann können Sie nur setzen Sie das style-Attribut der Zelle-je nachdem, ob es eine Zeile - element als Kind
Als eine Seite-Problem, haben Sie die processing instruction
<?mso-application progid="Excel.Sheet"?>
in Ihre XSLT. Dies ist nicht der richtige Ort für es, als es braucht, zu erscheinen, in der Ihre XML-Ausgabe, und das geschieht nicht aktuell. Die Ausgabe dieses Prozesses Anweisung, die Sie brauchen, um dies zu tunHier ist die vollständige XSLT in seiner ganzen Pracht dann....
Toll, genau das, was ich brauchte,dachte ich, machen Stile für Einzug,aber das funktioniert auch.Dank Tim
Ah ja. Ich ursprünglich übersehen der Tatsache Sie kann haben spezifische styling für die Einrückung. Das Auffüllen mit Leerzeichen war etwas einfacher (sonst würden Sie eigene Formatvorlagen für jede Ebene der Einrückung, und auch, ob Sie Kursiv oder nicht. In Ihrem Fall würde dies müssen 6 verschiedene Arten).
InformationsquelleAutor Tim C