Skip to content

Commit

Permalink
Add support for vann:termGroup (closed #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgkim committed Mar 7, 2014
1 parent 5dec1a5 commit 5ae1fd5
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions vocab-html-docs.xsl
Expand Up @@ -242,6 +242,10 @@
<li><a href="#sec-namespace">Namespace</a></li>
</xsl:if>

<xsl:if test="count(*[@rdf:about=$identifier]/vann:termGroup)&gt;0">
<li><a href="#sec-groups">Terms Grouped by Theme</a></li>
</xsl:if>

<li><a href="#sec-terms">Summary of Terms</a></li>

<xsl:if test="count($classes)&gt;0">
Expand Down Expand Up @@ -316,6 +320,42 @@
</pre>
</xsl:if>

<xsl:if test="count(*[@rdf:about=$identifier]/vann:termGroup)&gt;0">
<h2 id="sec-groups">Terms Grouped by Theme</h2>

<ul class="groupList">
<xsl:for-each select="*[@rdf:about=$identifier]/vann:termGroup">
<xsl:variable name="group" select="@rdf:resource"/>
<li>
<p class="definition">
<strong>
<xsl:value-of select="/*/*[@rdf:about=$group]/rdfs:label"/>:
</strong>
<xsl:value-of select="/*/*[@rdf:about=$group]/rdfs:comment"/>
</p>
<p>
<xsl:for-each select="/*/*[@rdf:about=$group]/*[translate(name(.), '0123456789', '')='_'] | /*/*[@rdf:about=$group]/rdf:li">
<xsl:if test="count(/*/*[@rdf:about=$group]/*[translate(name(.), '0123456789', '')='_'] | /*/*[@rdf:about=$group]/rdf:li)&gt;1">
<xsl:choose>
<xsl:when test="not(position()=1) and not(position()=last())">
<xsl:text>, </xsl:text>
</xsl:when>
<xsl:when test="position()=last()">
<xsl:text> and </xsl:text>
</xsl:when>
</xsl:choose>
</xsl:if>

<xsl:call-template name="MakeTermReference">
<xsl:with-param name="uri" select="@rdf:resource"/>
</xsl:call-template>
</xsl:for-each>
</p>
</li>
</xsl:for-each>
</ul>
</xsl:if>

<h2 id="sec-terms">Summary of Terms</h2>
<p>
This vocabulary defines
Expand Down Expand Up @@ -971,6 +1011,9 @@
body ins, body del { display: block; }
body * ins, body * del { display: inline; }

.groupList li p:first-child { margin: 0; }
.groupList li p:first-child + p { margin: 0 1em 1em 1em; }

table.properties { width: 90%; }
table.properties th { text-align: right; width: 10em; font-weight: normal;}

Expand Down

0 comments on commit 5ae1fd5

Please sign in to comment.