Skip to content

Commit

Permalink
add the root namespace to the Matroska Schema
Browse files Browse the repository at this point in the history
So it can be validated properly

Adjust the XSLT transform to match the elements with a non-empty namespace
  • Loading branch information
robUx4 committed Jul 13, 2019
1 parent fdb50b0 commit f904469
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ebml_matroska.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<EBMLSchema docType="matroska" version="4">
<EBMLSchema docType="matroska" version="4" xmlns="https://ietf.org/cellar/ebml">
<!-- constraints on EBML Header Elements -->
<element name="EBMLMaxIDLength" path="1*1(\EBML\EBMLMaxIDLength)" id="0x42F2" minOccurs="1" maxOccurs="1" range="4" default="4" type="uinteger"/>
<element name="EBMLMaxSizeLength" path="1*1(\EBML\EBMLMaxSizeLength)" id="0x42F3" minOccurs="1" maxOccurs="1" range="1-8" default="8" type="uinteger"/>
Expand Down
20 changes: 10 additions & 10 deletions transforms/ebml_schema2markdown4rfc.xsl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:str="http://exslt.org/strings">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:str="http://exslt.org/strings" xmlns:ebml="https://ietf.org/cellar/ebml" >
<xsl:output encoding="UTF-8" method="text" version="1.0" indent="yes" />
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:template match="EBMLSchema">
<xsl:apply-templates select="//element"/>
<xsl:template match="ebml:EBMLSchema">
<xsl:apply-templates select="//ebml:element"/>
</xsl:template>
<xsl:template match="element">
<xsl:template match="ebml:element">
<xsl:choose>
<xsl:when test="contains(@path,'\EBML\')">
<xsl:text>##</xsl:text>
Expand Down Expand Up @@ -88,7 +88,7 @@
<xsl:value-of select="@maxver"/>
<xsl:text>`&#xa;&#xa;</xsl:text>
</xsl:if>
<xsl:for-each select="documentation">
<xsl:for-each select="ebml:documentation">
<xsl:choose>
<xsl:when test="@type">
<xsl:value-of select="@type"/>
Expand All @@ -99,26 +99,26 @@
<xsl:value-of select="."/>
<xsl:text>&#xa;&#xa;</xsl:text>
</xsl:for-each>
<xsl:for-each select="restriction">
<xsl:for-each select="ebml:restriction">
<xsl:text>restrictions:&#xa;&#xa;</xsl:text>
<xsl:choose>
<xsl:when test="enum/documentation">
<xsl:when test="ebml:enum/ebml:documentation">
<xsl:text>|value|label|documentation|&#xa;</xsl:text>
<xsl:text>|:---|:---|:---|&#xa;</xsl:text>
<xsl:for-each select="enum">
<xsl:for-each select="ebml:enum">
<xsl:text>|`</xsl:text>
<xsl:value-of select="@value"/>
<xsl:text>` |</xsl:text>
<xsl:value-of select="@label"/>
<xsl:text> |</xsl:text>
<xsl:value-of select="documentation"/>
<xsl:value-of select="ebml:documentation"/>
<xsl:text> |&#xa;</xsl:text>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:text>|value|label|&#xa;</xsl:text>
<xsl:text>|:---|:---|&#xa;</xsl:text>
<xsl:for-each select="enum">
<xsl:for-each select="ebml:enum">
<xsl:text>|`</xsl:text>
<xsl:value-of select="@value"/>
<xsl:text>` |</xsl:text>
Expand Down

0 comments on commit f904469

Please sign in to comment.