Skip to content

Commit

Permalink
Ironing out broken links (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
wendellpiez authored Jun 7, 2021
1 parent d5cfbee commit a87f01f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions toolchains/xslt-M4/document/json/json-definitions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exclude-result-prefixes="#all">
<span class="usa-tag">JSON Schema</span>
<xsl:text> </xsl:text>
<a
href="/artifacts/json/schema/oscal_{$file-map(.)}_schema.json"
href="https://pages.nist.gov/OSCAL/artifacts/json/schema/oscal_{$file-map(.)}_schema.json"
>oscal_{$file-map(string(.))}_schema.json</a>
</p>
</xsl:template>
Expand Down Expand Up @@ -102,10 +102,10 @@ exclude-result-prefixes="#all">
<p>
<span class="usa-tag">XML to JSON converter</span>
<xsl:text> </xsl:text>
<a href="/artifacts/json/convert/oscal_{$file-map(.)}_xml-to-json-converter.xsl"
<a href="https://pages.nist.gov/OSCAL/artifacts/xml/convert/oscal_{$file-map(.)}_xml-to-json-converter.xsl"
>oscal_{$file-map(string(.))}_xml-to-json-converter.xsl</a>
<xsl:text> </xsl:text>
<a href="https://github.com/usnistgov/OSCAL/tree/main/json#converting-oscal-xml-content-to-json"
<a href="https://github.com/usnistgov/OSCAL/tree/master/xml#converting-oscal-xml-content-to-json"
>(How do I use the converter to convert OSCAL XML to JSON)</a>
</p>
</xsl:template>
Expand Down
6 changes: 3 additions & 3 deletions toolchains/xslt-M4/document/json/object-reference-html.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0"
exclude-result-prefixes="#all">

<xsl:output indent="true"/>
<!-- produces an HTML 'stub' to be inserted into Hugo -->

<xsl:param name="json-reference-page">json/reference</xsl:param>
Expand Down Expand Up @@ -67,11 +68,10 @@
<xsl:apply-templates/>
</div>
</xsl:template>


<!-- Map traversal -->
<!-- Map traversal -->
<xsl:template match="*[exists(@key)]" expand-text="true">
<xsl:variable name="level" select="count(ancestor-or-self::*[exists(@gi)])"/>
<xsl:variable name="level" select="count(ancestor-or-self::*[exists(@key)])"/>
<xsl:variable name="header-tag" select="if ($level le 6) then ('h' || $level) else 'p'"/>
<xsl:variable name="grouped-object" select="(self::array | self::singleton-or-array)/*"/>
<xsl:variable name="me" select="($grouped-object,.)[1]"/>
Expand Down
4 changes: 2 additions & 2 deletions toolchains/xslt-M4/document/xml/element-reference-html.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<div class="{ $header-class }">
<!-- generates h1-hx headers picked up by Hugo toc -->
<xsl:element expand-text="true" name="{ $header-tag }" namespace="http://www.w3.org/1999/xhtml">
<xsl:attribute name="id" select="@_tree-json-id"/>
<xsl:attribute name="id" select="@_tree-xml-id"/>
<xsl:attribute name="class">toc{ $level} name</xsl:attribute>
<xsl:text>{ @gi }</xsl:text>
</xsl:element>
Expand Down Expand Up @@ -141,7 +141,7 @@
<xsl:value-of select="local-name()"/><br />
<xsl:if test="@scope='global'">
<xsl:text> </xsl:text>
<a class="definition-link" href="{$path-to-common || $xml-definitions-page }#{ @_metaschema-json-id }">(global definition)</a>
<a class="definition-link" href="{$path-to-common || $xml-definitions-page }#{ @_metaschema-xml-id }">(global definition)</a>
</xsl:if>
</xsl:template>

Expand Down

0 comments on commit a87f01f

Please sign in to comment.