Skip to content

Commit

Permalink
Revisiting usnistgov#448 (inserting more documentation into XSD): it …
Browse files Browse the repository at this point in the history
…actually works now
  • Loading branch information
wendellpiez authored and david-waltermire committed Aug 16, 2019
1 parent 0080d0d commit 6a97faa
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions build/metaschema/xml/produce-xsd.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@
<xsl:for-each select="$composed-metaschema/METASCHEMA/schema-version">
<xsl:attribute name="version" select="normalize-space(.)"/>
</xsl:for-each>
<xs:annotation>
<xs:appinfo>
<xsl:apply-templates select="$composed-metaschema/METASCHEMA/*" mode="header-documentation"/>
</xs:appinfo>
</xs:annotation>
<xsl:apply-templates select="$composed-metaschema/METASCHEMA/*"/>
<!--<xsl:apply-templates select="*"/>-->

<xsl:if test="exists($composed-metaschema//prose)">
<xs:group name="prose">
Expand All @@ -82,11 +86,16 @@

<xsl:template match="namespace"/>

<xsl:template match="/METASCHEMA/schema-name | /METASCHEMA/short-name |
/METASCHEMA/schema-version | /METASCHEMA/remarks/*">
<xsl:template mode="header-documentation" match="*"/>

<xsl:template mode="header-documentation" match="/METASCHEMA/schema-name | /METASCHEMA/short-name |
/METASCHEMA/schema-version | /METASCHEMA/remarks">
<xsl:copy-of select="."/>
</xsl:template>

<xsl:template match="/METASCHEMA/schema-name | /METASCHEMA/short-name |
/METASCHEMA/schema-version | /METASCHEMA/remarks"/>

<xsl:template match="field | assembly">
<xs:element ref="{$declaration-prefix}:{@ref}"
minOccurs="{ if (exists(@min-occurs)) then @min-occurs else 0 }"
Expand Down Expand Up @@ -140,9 +149,9 @@

<xsl:template match="define-flag | define-field | define-assembly | flag[exists(formal-name| description)]" mode="annotated">
<xs:annotation>
<xs:appInfo>
<xs:appinfo>
<xsl:copy-of select="formal-name, description"/>
</xs:appInfo>
</xs:appinfo>
<xs:documentation>
<xsl:apply-templates select="formal-name, description"/>
</xs:documentation>
Expand Down

0 comments on commit 6a97faa

Please sign in to comment.