Skip to content

Commit

Permalink
generate term links
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-n-cooper committed May 20, 2018
1 parent bb8b056 commit 11ccdf4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions xslt/generate-structure-xml.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
<xsl:variable name="alts" select="tokenize(@data-lt, '\|')"></xsl:variable>
<term>
<id><xsl:text>dfn-</xsl:text><xsl:value-of select="wcag:generate-id(.)"/></id>
<name><xsl:value-of select="."/></name>
<name><xsl:value-of select="lower-case(.)"/></name>
<xsl:for-each select="$alts">
<name><xsl:value-of select="."/></name>
<name><xsl:value-of select="lower-case(.)"/></name>
</xsl:for-each>
</term>
</xsl:template>
Expand Down
9 changes: 8 additions & 1 deletion xslt/generate-understanding.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<xsl:param name="base.dir">understanding/</xsl:param>
<xsl:param name="output.dir">output/</xsl:param>
<xsl:param name="loc.guidelines">https://www.w3.org/TR/WCAG21/</xsl:param>

<xsl:template name="name">
<xsl:param name="meta" tunnel="yes"/>
Expand Down Expand Up @@ -162,7 +163,7 @@
<xsl:choose>
<xsl:when test="name($meta) = 'guideline' or name($meta) = 'success-criterion'">
<blockquote class="scquote">
<xsl:copy-of select="$meta/content/html:*"/>
<xsl:apply-templates select="$meta/content/html:*"/>
<xsl:if test="name($meta) = 'success-criterion'"><p>(Level <xsl:value-of select="$meta/level"/>)</p></xsl:if>
</blockquote>
<main>
Expand Down Expand Up @@ -284,6 +285,12 @@
</xsl:copy>
</xsl:template>

<xsl:template match="html:a[not(@href)]">
<xsl:param name="meta" tunnel="yes"/>
<xsl:variable name="dfn" select="lower-case(.)"/>
<a href="{$loc.guidelines}#{$meta/ancestor::guidelines/term[name = $dfn]/id}"><xsl:value-of select="."/></a>
</xsl:template>

<xsl:template match="html:*[@class = 'instructions']"/>

</xsl:stylesheet>

0 comments on commit 11ccdf4

Please sign in to comment.