Skip to content

Commit

Permalink
Fix: Handle RNC for alts elements in GMP doc
Browse files Browse the repository at this point in the history
When generating the RNC schema for elements, handle the case where
an alts type is used.

This fixes the schema showing "ERROR" instead of the expected pattern.
  • Loading branch information
timopollmeier committed Jul 6, 2023
1 parent eb5b209 commit 955357b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/schema_formats/rnc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,25 @@ response
<xsl:with-param name="parent-name" select="$parent-name"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="name()='alts'">
<xsl:for-each select="alt">
<xsl:choose>
<xsl:when test="following-sibling::alt and preceding-sibling::alt">
<xsl:text>|</xsl:text>
<xsl:value-of select="."/>
</xsl:when>
<xsl:when test="count (following-sibling::alt) = 0">
<xsl:text>|</xsl:text>
<xsl:value-of select="."/>
<xsl:text>" }</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>xsd:token { pattern = "</xsl:text>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<xsl:when test="name()='t'">
</xsl:when>
<xsl:otherwise>
Expand Down

0 comments on commit 955357b

Please sign in to comment.