Skip to content

Commit

Permalink
bookmarks to pointers
Browse files Browse the repository at this point in the history
Cf. #29
  • Loading branch information
dariok committed Apr 16, 2019
1 parent fe9fb98 commit 609d9fc
Show file tree
Hide file tree
Showing 3 changed files with 390 additions and 15 deletions.
64 changes: 60 additions & 4 deletions wt0-result.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?><html xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test Report for home/dario/git/w2tei/wt0.xsl (passed: 2 / pending: 0 / failed: 0 / total: 2)</title>
<title>Test Report for home/dario/git/w2tei/wt0.xsl (passed: 4 / pending: 0 / failed: 0 / total: 4)</title>
<link rel="stylesheet" type="text/css" href="file:/home/dario/.p2/pool/plugins/com.oxygenxml.editor_20.1.0.v2018122403/frameworks/xspec/src/reporter/test-report.css" />
</head>
<body>
<h1>Test Report</h1>
<p>Stylesheet: <a href="file:/home/dario/git/w2tei/wt0.xsl">home/dario/git/w2tei/wt0.xsl</a></p>
<p>Tested: 16 April 2019 at 14:53</p>
<p>Tested: 16 April 2019 at 16:04</p>
<h2>Contents</h2>
<table class="xspec">
<col width="75%" />
Expand All @@ -18,10 +18,10 @@ <h2>Contents</h2>
<thead>
<tr>
<th></th>
<th class="totals">passed: 2</th>
<th class="totals">passed: 4</th>
<th class="totals">pending: 0</th>
<th class="totals">failed: 0</th>
<th class="totals">total: 2</th>
<th class="totals">total: 4</th>
</tr>
</thead>
<tbody>
Expand All @@ -32,6 +32,20 @@ <h2>Contents</h2>
<th class="totals">0</th>
<th class="totals">2</th>
</tr>
<tr class="successful">
<th><a href="#d3e709">T2: p</a></th>
<th class="totals">1</th>
<th class="totals">0</th>
<th class="totals">0</th>
<th class="totals">1</th>
</tr>
<tr class="successful">
<th><a href="#d3e982">T3: bookmarks, comments, etc.</a></th>
<th class="totals">1</th>
<th class="totals">0</th>
<th class="totals">0</th>
<th class="totals">1</th>
</tr>
</tbody>
</table>
<div id="d3e4">
Expand Down Expand Up @@ -63,5 +77,47 @@ <h2 class="successful">T1: structure<span class="scenario-totals">passed: 2 / pe
</tbody>
</table>
</div>
<div id="d3e709">
<h2 class="successful">T2: p<span class="scenario-totals">passed: 1 / pending: 0 / failed: 0 / total: 1</span></h2>
<table class="xspec" id="t-d3e709">
<col width="75%" />
<col width="25%" />
<tbody>
<tr class="successful">
<th>T2: p</th>
<th>passed: 1 / pending: 0 / failed: 0 / total: 1</th>
</tr>
<tr class="successful">
<th>T2.1</th>
<th>passed: 1 / pending: 0 / failed: 0 / total: 1</th>
</tr>
<tr class="successful">
<td>.</td>
<td>Success</td>
</tr>
</tbody>
</table>
</div>
<div id="d3e982">
<h2 class="successful">T3: bookmarks, comments, etc.<span class="scenario-totals">passed: 1 / pending: 0 / failed: 0 / total: 1</span></h2>
<table class="xspec" id="t-d3e982">
<col width="75%" />
<col width="25%" />
<tbody>
<tr class="successful">
<th>T3: bookmarks, comments, etc.</th>
<th>passed: 1 / pending: 0 / failed: 0 / total: 1</th>
</tr>
<tr class="successful">
<th>T3.1</th>
<th>passed: 1 / pending: 0 / failed: 0 / total: 1</th>
</tr>
<tr class="successful">
<td>.</td>
<td>Success</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
15 changes: 13 additions & 2 deletions wt0.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@
</xsl:attribute>
</xsl:template>

<xsl:template match="w:r[not(*) or not(w:rPr/following-sibling::*)]" />

<xsl:template match="w:r[w:t or w:sym]">
<ab>
<xsl:sequence select="w:t/@xml:space" />
<xsl:apply-templates select="w:rPr" />
<xsl:apply-templates select="w:t | w:sym" />
</ab>
Expand Down Expand Up @@ -109,7 +112,6 @@
<field>
<xsl:attribute name="function">
<xsl:text>HYPERLKINK</xsl:text>

</xsl:attribute>
<xsl:apply-templates select="w:r" />
</field>
Expand Down Expand Up @@ -138,7 +140,7 @@
</xsl:template>
<xsl:template match="w:endnote">
<note type="endnote" xml:id="e{@w:id}">
<xsl:apply-templates select="w:p//w:pStyle" />
<xsl:apply-templates select="w:p//w:pPr" />
<xsl:apply-templates select="w:p/w:r | w:p/w:hyperlink" />
</note>
</xsl:template>
Expand All @@ -165,4 +167,13 @@
</note>
</xsl:template>
<xsl:template match="w:r[w:annotationRef]" />

<xsl:template match="w:bookmarkStart[@name = '_GoBack']" />
<xsl:template match="w:bookmarkStart">
<ptr type="bookmarkStart" xml:id="b{@w:id}" ref="{translate(@w:name, '_', '#')}" />
</xsl:template>
<xsl:template match="w:bookmarkEnd">
<ptr type="bookmarkEnd" ref="#b{@w:id}" />
</xsl:template>

</xsl:stylesheet>
Loading

0 comments on commit 609d9fc

Please sign in to comment.