Mercurial > hg > ooxml
comparison shared.xsl @ 48:5d9806f90896
basic integration of shared, but copying <f> is wrong, should reconstruct by denormalising <nf> for new home
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Wed, 10 May 2017 16:52:04 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
47:3e9a3e51627e | 48:5d9806f90896 |
---|---|
1 <?xml version='1.0'?> | |
2 <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" > | |
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 s e xf" xmlns="http://markup.co.uk/excel" xmlns:xf="http://www.w3.org/2005/xpath-functions"> | |
4 | |
5 <xsl:template match="/"> | |
6 <masters><xsl:apply-templates select="/s:worksheet/s:sheetData"/></masters> | |
7 </xsl:template> | |
8 | |
9 <xsl:template match="s:sheetData"> | |
10 <xsl:variable select="s:row/s:c/s:f[@si]" name="sfs"/> | |
11 <xsl:variable name="indices" select="distinct-values(for $sf in $sfs/@si return string($sf))"> | |
12 <!-- s:f/@si values --> | |
13 </xsl:variable> | |
14 | |
15 <xsl:for-each select="$indices"> | |
16 <xsl:variable name="i" select="."/> | |
17 <xsl:variable name="sf" select="($sfs[@si=$i])[1]"/> | |
18 <master si="{$i}" r="{$sf/../@r}"><xsl:value-of select="$sf"/></master> | |
19 </xsl:for-each> | |
20 </xsl:template> | |
21 </xsl:stylesheet> |