File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 19
19
<!-- All XREFs must be tagged with a @data-type containing XREF -->
20
20
<xsl : template match =" h:a[contains(@data-type, 'xref')]" >
21
21
<xsl : param name =" autogenerate-xrefs" select =" $autogenerate-xrefs" />
22
- <xsl : variable name =" href-anchor" >
23
- <xsl : choose >
24
- <!-- If href contains an # (as it should), we're going to assume the subsequent text is the referent id -->
25
- <xsl : when test =" contains(@href, '#')" >
26
- <xsl : value-of select =" substring-after(@href, '#')" />
27
- </xsl : when >
28
- <!-- Otherwise, we'll just assume the entire href is the referent id -->
29
- <xsl : otherwise >
30
- <xsl : value-of select =" @href" />
31
- </xsl : otherwise >
32
- </xsl : choose >
22
+ <xsl : variable name =" calculated-output-href" >
23
+ <xsl : call-template name =" calculate-output-href" >
24
+ <xsl : with-param name =" source-href-value" select =" @href" />
25
+ </xsl : call-template >
33
26
</xsl : variable >
27
+ <xsl : variable name =" href-anchor" select =" substring-after($calculated-output-href, '#')" />
34
28
<xsl : copy >
35
- <xsl : apply-templates select =" @*" />
36
- <xsl : choose >
29
+ <xsl : apply-templates select =" @*[not(name(.) = 'href')]" />
30
+ <xsl : attribute name =" href" select =" $calculated-output-href" />
31
+ <xsl : choose >
37
32
<!-- Generate XREF text node if $autogenerate-xrefs is enabled -->
38
33
<xsl : when test =" $autogenerate-xrefs = 1" >
39
34
<xsl : choose >
You can’t perform that action at this time.
0 commit comments