Mercurial > hg > ooxml
annotate merge.xsl @ 45:6ed900e8cc61
towards comparable formulae
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Sun, 07 May 2017 19:21:53 +0100 |
parents | 6f448ac67778 |
children | 3e9a3e51627e |
rev | line source |
---|---|
42
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
1 <?xml version='1.0'?> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
2 <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" > |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.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" exclude-result-prefixes="xs e s xpf" xmlns="http://markup.co.uk/excel" xmlns:xpf="http://www.w3.org/2005/xpath-functions"> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
4 <xsl:strip-space elements="s:sheetData"/> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
5 |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
6 <xsl:include href="a2n.xsl"/> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
7 <xsl:include href="n2a.xsl"/> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
8 |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
9 <xsl:variable name="refs" select="collection()[2]/*"/> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
10 |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
11 <xsl:key name="ref" match="e:i" use="@r"/> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
12 |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
13 <xsl:template match="e:r/e:c"> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
14 <xsl:variable name="row" select="../@r"/> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
15 <xsl:variable name="col" select="@c"/> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
16 <xsl:variable name="reffed" select="key('ref',concat(e:n2a($col),$row),$refs)"/> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
17 <c> |
45
6ed900e8cc61
towards comparable formulae
Henry S. Thompson <ht@markup.co.uk>
parents:
42
diff
changeset
|
18 <xsl:apply-templates select="@*"/> |
6ed900e8cc61
towards comparable formulae
Henry S. Thompson <ht@markup.co.uk>
parents:
42
diff
changeset
|
19 <xsl:if test="e:f"> |
6ed900e8cc61
towards comparable formulae
Henry S. Thompson <ht@markup.co.uk>
parents:
42
diff
changeset
|
20 <xsl:attribute name="f"></xsl:attribute> |
6ed900e8cc61
towards comparable formulae
Henry S. Thompson <ht@markup.co.uk>
parents:
42
diff
changeset
|
21 </xsl:if> |
42
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
22 <xsl:if test="$reffed"><xsl:copy-of select="$reffed"/></xsl:if> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
23 </c> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
24 </xsl:template> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
25 |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
26 <xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
27 </xsl:template> |
6f448ac67778
merge working with new refs(2), rect
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
28 </xsl:stylesheet> |