annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
2c115aefde6b beginning work on elaboration of worksheets
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
1 <?xml version='1.0'?>
2c115aefde6b beginning work on elaboration of worksheets
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
2 <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" >
4
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
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">
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
4 <xsl:param name="elabDir"/>
3
2c115aefde6b beginning work on elaboration of worksheets
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
5 <xsl:variable name="xldir" select="replace(base-uri(),'/[^/]*/[^/]*$','')"/>
4
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
6 <xsl:variable name="fmts" select="document($elabDir/fmt.xml)/fmts/fmt"/>
3
2c115aefde6b beginning work on elaboration of worksheets
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
7 <xsl:variable name="styles" select="document(concat($xldir,'/styles.xml'))/*"></xsl:variable>
4
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
8 <xsl:variable name="xfs" select="$styles//s:cellXfs/s:xf"/>
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
9 <xsl:template match="s:c">
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
10 <xsl:if test="@s">
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
11 <s:c e:type="{$xfs[position()=current()/@s]/@numFmtId}">
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
12 <xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
13 <xsl:apply-templates/>
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
14 </s:c>
fe3fc6b2d890 1st level of format type lookup
Henry S. Thompson <ht@markup.co.uk>
parents: 3
diff changeset
15 </xsl:if>
3
2c115aefde6b beginning work on elaboration of worksheets
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
16 </xsl:template>
2c115aefde6b beginning work on elaboration of worksheets
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
17 </xsl:stylesheet>