Skip to content

Commit

Permalink
Adding support for administrative divisions. openva#22
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Hunt committed Mar 9, 2017
1 parent 5e753b6 commit 70d6c87
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lexis-nexis.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,25 @@
<xsl:value-of select="@levelType"/>
</xsl:attribute>

<xsl:attribute name="identifier">
<xsl:value-of select="replace(replace(normalize-space(heading/desig), '^(TITLE|SUBTITLE|ARTICLE|CHAPTER|SUBCHAPTER|PART) ', '' ), '.$', '')"/>
</xsl:attribute>

<!-- Counter -->
<xsl:attribute name="level">
<xsl:value-of select="count(ancestor::hierarchyLevel) + 1"/>
</xsl:attribute>

<xsl:value-of select="fn:capitalize_phrase(heading/title)"/>

<!-- If we have a title, desig is the identifier. Otherwise, the desig is the title. -->
<xsl:choose>
<xsl:when test="heading/title">
<xsl:attribute name="identifier">
<xsl:value-of select="replace(replace(normalize-space(heading/desig), '^(TITLE|SUBTITLE|ARTICLE|CHAPTER|SUBCHAPTER|PART) ', '' ), '.$', '')"/>
</xsl:attribute>
<xsl:value-of select="fn:capitalize_phrase(heading/title)"/>
</xsl:when>

<xsl:otherwise>
<xsl:value-of select="fn:capitalize_phrase(heading/desig)"/>
</xsl:otherwise>
</xsl:choose>

</unit>

<xsl:if test="hierarchyLevel">
Expand Down

0 comments on commit 70d6c87

Please sign in to comment.