Skip to content

Commit

Permalink
adding key terms, first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-n-cooper committed May 22, 2018
1 parent d70f992 commit d8b0a9a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xslt/generate-structure-xml.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
<xsl:for-each select="$alts">
<name><xsl:value-of select="lower-case(.)"/></name>
</xsl:for-each>
<definition>
<xsl:copy-of select="../following-sibling::html:dd[1]/node()"/>
</definition>
</term>
</xsl:template>

Expand Down
24 changes: 24 additions & 0 deletions xslt/generate-understanding.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,29 @@
<p><xsl:copy-of select="$sc-info"/><xsl:apply-templates/></p>
</xsl:template>

<xsl:template name="key-terms">
<xsl:param name="meta" tunnel="yes"/>
<xsl:variable name="termrefs" select="//html:a[not(@href)] | $meta/content/descendant::html:a[not(@href)]"/>
<xsl:if test="$termrefs">
<xsl:variable name="termids" as="node()*">
<xsl:for-each select="$termrefs">
<xsl:copy-of select="$meta/ancestor::guidelines/term[name = current()]"/>
</xsl:for-each>
</xsl:variable>
<section id="key-terms">
<h2>Key Terms</h2>
<xsl:apply-templates select="$termids" mode="key-terms">
<xsl:sort select="id"/>
</xsl:apply-templates>
</section>
</xsl:if>
</xsl:template>

<xsl:template match="term" mode="key-terms">
<dt id="{id}"><xsl:value-of select="name[1]"/></dt>
<dd><xsl:apply-templates select="definition"/></dd>
</xsl:template>

<xsl:template match="guidelines">
<xsl:apply-templates select="//understanding | //guideline | //success-criterion"/>
</xsl:template>
Expand Down Expand Up @@ -217,6 +240,7 @@
<xsl:apply-templates select="//html:section[@id = 'advisory']" mode="gladvisory"/>
<xsl:call-template name="gl-sc"/>
</xsl:if>
<xsl:call-template name="key-terms"/>
</main>
</xsl:when>
<xsl:when test="name($meta) = 'understanding'">
Expand Down

0 comments on commit d8b0a9a

Please sign in to comment.