Skip to content

Commit

Permalink
adjust bookmark's ptr(ref) to anchor(corresp or ref)
Browse files Browse the repository at this point in the history
w:bookmark is the target rather then a ptr (the ptr is
created by a field with NOTEREF)
Cf. #29
  • Loading branch information
dariok committed Apr 16, 2019
1 parent 609d9fc commit a5d8bdd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion wt0-result.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<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 16:04</p>
<p>Tested: 16 April 2019 at 16:34</p>
<h2>Contents</h2>
<table class="xspec">
<col width="75%" />
Expand Down
5 changes: 3 additions & 2 deletions wt0.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@

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

</xsl:stylesheet>
4 changes: 2 additions & 2 deletions wt0.xspec
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@
<p style="KSZwischenberschrift; lang:en-US">
<ab style="lang:en-US">conformare</ab>
<ab style="lang:en-US">.</ab>
<ptr type="bookmarkStart" xml:id="b2" ref="#Ref534135879"/>
<anchor type="bookmarkStart" xml:id="_Ref534135879"/>
<ptr type="endnote" ref="#e2" />
<ptr type="bookmarkEnd" ref="#b2"/>
<anchor type="bookmarkEnd" ref="#_Ref534135879"/>
<ab style="lang:en-US">&#xF05e;</ab>
</p>
</div>
Expand Down

0 comments on commit a5d8bdd

Please sign in to comment.