annotate refs.xsl @ 20:104ef815b0b0

fix false negs, add mouseover to show refs
author Henry S. Thompson <ht@markup.co.uk>
date Tue, 04 Apr 2017 18:04:13 +0100
parents 16bba7a0d0bd
children f05f0d0ee296
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
1 <?xml version='1.0'?>
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
2 <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" >
18
16bba7a0d0bd one form of refs output, not sure it's what is wanted...
Henry S. Thompson <ht@markup.co.uk>
parents: 17
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 s" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xf="http://www.w3.org/2005/xpath-functions">
17
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
4 <xsl:variable name="pat1">("[^"]*")|(\{[^}]+})|(,)|([^=\-+*/();:,.$&lt;>^!]+(?:\.[^=\-+*/();:,.$&lt;>^!]+)*\()|([)])|(^=|\()|((?:'[^']+')|(?:\[[0-9]+\][^!]*))|(\$?[A-Z]+\$?[0-9]+)|([a-zA-Z_\\][a-zA-Z0-9._]*)|(.)</xsl:variable>
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
5 <xsl:param name="pat" select="$pat1"/>
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
6
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
7 <xsl:template match="/">
18
16bba7a0d0bd one form of refs output, not sure it's what is wanted...
Henry S. Thompson <ht@markup.co.uk>
parents: 17
diff changeset
8 <e:refs><xsl:apply-templates select="//s:c"/></e:refs>
17
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
9 </xsl:template>
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
10
18
16bba7a0d0bd one form of refs output, not sure it's what is wanted...
Henry S. Thompson <ht@markup.co.uk>
parents: 17
diff changeset
11 <xsl:template match="s:c[s:f]">
16bba7a0d0bd one form of refs output, not sure it's what is wanted...
Henry S. Thompson <ht@markup.co.uk>
parents: 17
diff changeset
12 <xsl:variable name="refs" select="analyze-string(.,$pat)/xf:match/xf:group[@nr=8]"/>
16bba7a0d0bd one form of refs output, not sure it's what is wanted...
Henry S. Thompson <ht@markup.co.uk>
parents: 17
diff changeset
13 <xsl:if test="$refs"><e:ref c="{@r}" r="{for $ref in $refs return translate($ref,'$','')}"/></xsl:if>
17
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
14 </xsl:template>
18
16bba7a0d0bd one form of refs output, not sure it's what is wanted...
Henry S. Thompson <ht@markup.co.uk>
parents: 17
diff changeset
15
16bba7a0d0bd one form of refs output, not sure it's what is wanted...
Henry S. Thompson <ht@markup.co.uk>
parents: 17
diff changeset
16 <xsl:template match="s:c"/>
17
a874f2a81ed2 default vis pipeline to raw xml, start extracting refs
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
17 </xsl:stylesheet>