Mercurial > hg > ooxml
changeset 44:5b2333e59d91
updated html, ascii output to new raw doctype
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Sun, 07 May 2017 11:56:02 +0100 |
parents | 5469a32795da |
children | 6ed900e8cc61 |
files | ascii.xsl html.xsl |
diffstat | 2 files changed, 19 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/ascii.xsl Sun May 07 11:55:50 2017 +0100 +++ b/ascii.xsl Sun May 07 11:56:02 2017 +0100 @@ -1,6 +1,6 @@ <?xml version='1.0'?> <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" > -<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 xpf" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xpf="http://www.w3.org/2005/xpath-functions"> +<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 xpf e" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xpf="http://www.w3.org/2005/xpath-functions"> <xsl:strip-space elements="e:a"/> <xsl:output omit-xml-declaration="yes"/> @@ -17,10 +17,10 @@ </xsl:template> <xsl:template match="e:c"> - <xsl:value-of select="if (e:t) + <xsl:value-of select="if (@t or text()) then - let $v := if (e:t/@c) then e:t/@c else e:t return - if (@f) + let $v := if (@t) then @t else text() return + if (e:f) then translate($v,'cdens','CDENS') else $v else ' '"/>
--- a/html.xsl Sun May 07 11:55:50 2017 +0100 +++ b/html.xsl Sun May 07 11:56:02 2017 +0100 @@ -48,14 +48,23 @@ <xsl:template match="e:c"> <td> <xsl:choose> - <xsl:when test="e:t"> + <xsl:when test="@t|text()"> <xsl:attribute name="class"> - <xsl:value-of select="(e:t, - if (@f) then 'formula' else (), - if (e:r) then 'reffed' else ())"/> + <xsl:value-of select="(if (@t) then @t else text(), + if (e:f) then 'formula' else (), + if (e:i) then 'reffed' else ())"/> </xsl:attribute> - <xsl:attribute name="title"><xsl:value-of select="e:n2a(@c)"/><xsl:value-of select="../@r"/><xsl:if test="e:r">: <xsl:value-of select="e:r"/></xsl:if></xsl:attribute> - <xsl:value-of select="if (e:t/@c) then e:t/@c else e:t"/></xsl:when> + <xsl:attribute name="title"> + <xsl:choose> + <xsl:when test="e:i"> + <xsl:value-of select="e:i/@r"/>: <xsl:value-of select="e:i/e:r"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="e:n2a(@c)"/><xsl:value-of select="../@r"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:value-of select="if (@t) then @t else text()"/></xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> </td>