Mercurial > hg > ooxml
comparison format.xsl @ 4:fe3fc6b2d890
1st level of format type lookup
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Sat, 01 Apr 2017 21:44:19 +0800 |
parents | 2c115aefde6b |
children | 106bf970a867 |
comparison
equal
deleted
inserted
replaced
3:2c115aefde6b | 4:fe3fc6b2d890 |
---|---|
1 <?xml version='1.0'?> | 1 <?xml version='1.0'?> |
2 <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" > | 2 <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" > |
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:s="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> | 3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:s="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:e="http://markup.co.uk/excel"> |
4 <xsl:param name="elabDir"/> | |
4 <xsl:variable name="xldir" select="replace(base-uri(),'/[^/]*/[^/]*$','')"/> | 5 <xsl:variable name="xldir" select="replace(base-uri(),'/[^/]*/[^/]*$','')"/> |
6 <xsl:variable name="fmts" select="document($elabDir/fmt.xml)/fmts/fmt"/> | |
5 <xsl:variable name="styles" select="document(concat($xldir,'/styles.xml'))/*"></xsl:variable> | 7 <xsl:variable name="styles" select="document(concat($xldir,'/styles.xml'))/*"></xsl:variable> |
6 <xsl:variable name="cellXfs" select="$styles//s:cellXfs"/> | 8 <xsl:variable name="xfs" select="$styles//s:cellXfs/s:xf"/> |
7 <xsl:template match="/"> | 9 <xsl:template match="s:c"> |
8 <xsl:message>|<xsl:value-of select="count($cellXfs/s:xf)"/>|</xsl:message> | 10 <xsl:if test="@s"> |
11 <s:c e:type="{$xfs[position()=current()/@s]/@numFmtId}"> | |
12 <xsl:for-each select="@*"><xsl:copy/></xsl:for-each> | |
13 <xsl:apply-templates/> | |
14 </s:c> | |
15 </xsl:if> | |
9 </xsl:template> | 16 </xsl:template> |
10 </xsl:stylesheet> | 17 </xsl:stylesheet> |