Есть тестовый пример xml и xsl-файлов для создания xls. Только в примере не хватает описания как объявлять стили(типа задать рамку таблице или строке, или ячейке, а еще как цвет задавать и т.п.) Мож кто подсобит? | Код | <bdiData> <documentControlInfo> <documentInfo> <docDescription>PPD</docDescription> <docID> <ID>1</ID> </docID> <docModifier>Ltd. GBT</docModifier> <docCreateDate>2010-08-23</docCreateDate> <docCreateTime>07:08:54-0700</docCreateTime> <standardVersion>1.0</standardVersion> <testIndicator>0</testIndicator> <resendIndicator>0</resendIndicator> </documentInfo> <sourceInfo> <sourceName>Global Bussines Technologies</sourceName> <sourceID> <idOther>GBT</idOther> </sourceID> </sourceInfo> <destinationInfo> <destinationName>GBT</destinationName> <destinationID> <idOther>GBT</idOther> </destinationID> </destinationInfo> </documentControlInfo> <checkItemCollection> <collectionInfo> <description>Items</description> <ID>1</ID> <Classification> <classification>Items</classification> </Classification> </collectionInfo> <checkItemBatch> <checkItemBatchInfo> <description>Paid Checks</description> <ID>1</ID> <Classification> <classification>Paid Checks</classification> </Classification> </checkItemBatchInfo> <checkItem> <checkItemType>check</checkItemType> <checkAmount>2960</checkAmount> <postingInfo> <date>2009-06-12</date> <RT>87654321</RT> <accountNumber>123465798</accountNumber> <seqNum>007725552898</seqNum> <trancode>001152</trancode> <amount>2960</amount> <serialNumber>55225410</serialNumber> </postingInfo> </checkItem> </checkItemBatch> </checkItemCollection> </bdiData>
|
| Код | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel"> <xsl:template match="/"> <xsl:processing-instruction name="mso-application">progid="Excel.Sheet"</xsl:processing-instruction> <Workbook> <xsl:apply-templates/> </Workbook> </xsl:template> <xsl:template match="/*"> <Worksheet ss:Name="{*/*/*[local-name()='docDescription']}"> <Table x:FullColumns="1" x:FullRows="1"> <Row> <xsl:for-each select="*/*/*[local-name()='checkItem'][1]//*[not(*)]"> <Cell> <Data ss:Type="String"> <xsl:value-of select="local-name()"/> </Data> </Cell> </xsl:for-each> </Row> <xsl:apply-templates select="*/*/*[local-name()='checkItem']"/> </Table> </Worksheet> </xsl:template> <xsl:template match="*[local-name()='checkItem']" priority="1"> <Row> <xsl:apply-templates select=".//*[not(*)]"/> </Row> </xsl:template> <xsl:template match="*[not(*)]"> <Cell> <Data ss:Type="String"> <xsl:value-of select="."/> </Data> </Cell> </xsl:template> </xsl:stylesheet>
|
--------------------
менеджер по кодеврайтингу
|