1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <xsl:stylesheet version="1.0"
|
---|
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
4 | xmlns:java="http://xml.apache.org/xalan/java"
|
---|
5 | xmlns:util="ExternalRef" extension-element-prefixes="util">
|
---|
6 |
|
---|
7 | <xsl:template match="CrossRef">
|
---|
8 | <xsl:variable name="ref" select="@ref"/>
|
---|
9 | <xsl:if test="@external">
|
---|
10 | <xsl:variable name="external" select="@external"/>
|
---|
11 | <!--<a><xsl:attribute name="href"><xsl:value-of select="java:getRef($util, '@external', '@lang', '@target', '$ref')"/></xsl:attribute></a>-->
|
---|
12 | <a><xsl:attribute name="href"><xsl:value-of select="concat(@external, '_', @lang, '_all.html#', @target, '_', @ref)"/></xsl:attribute><xsl:value-of select="util:getRef($external, @lang, @target, $ref)"/></a>
|
---|
13 | </xsl:if>
|
---|
14 |
|
---|
15 | <a href="#{@target}_{@ref}">
|
---|
16 | <xsl:choose>
|
---|
17 | <xsl:when test="@target='Figure'"><xsl:apply-templates select="//Figure[@id=$ref]" mode="ref"/></xsl:when>
|
---|
18 | <xsl:when test="@target='Table'"><xsl:apply-templates select="//Table[@id=$ref]" mode="ref"/></xsl:when>
|
---|
19 | <xsl:when test="@target='Chapter'"><xsl:apply-templates select="//Chapter[@id=$ref]" mode="ref"/></xsl:when>
|
---|
20 | <xsl:when test="@target='Section'"><xsl:apply-templates select="//Section[@id=$ref]" mode="ref"/></xsl:when>
|
---|
21 | <xsl:when test="@target='Subsection'"><xsl:apply-templates select="//Subsection[@id=$ref]" mode="ref"/></xsl:when>
|
---|
22 | </xsl:choose>
|
---|
23 | </a>
|
---|
24 | </xsl:template>
|
---|
25 |
|
---|
26 | <xsl:template match="FootnoteList">
|
---|
27 | <xsl:for-each select="Footnote">
|
---|
28 | <p><a name="fn{@id}"/><a href="#fnref{@id}">[<xsl:value-of select="@id"/>]</a>
|
---|
29 | <xsl:apply-templates/></p>
|
---|
30 | </xsl:for-each>
|
---|
31 | </xsl:template>
|
---|
32 | <xsl:template match="FootnoteRef"><a name="fnref{@id}"/><a href="#fn{@id}">[<xsl:value-of select="@id"/>]</a></xsl:template>
|
---|
33 | </xsl:stylesheet>
|
---|