Ignore:
Timestamp:
01/14/16 12:05:44 (9 years ago)
Author:
Menzo Windhouwer
Message:

M toolkit/src/main/resources/toolkit/upgrade/cmd-record-1_1-to-1_2.xsl

  • unescaped escaped CMDI 1.2 attributes
  • warn when a @ref contains multiple resource proxy references, and use only the first one

M toolkit/src/main/resources/toolkit/downgrade/cmd-component-1_2-to-1_1.xsl

  • escape attributes that would clash with CMDI 1.1 reserved attributes

M toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd
A toolkit/src/main/resources/toolkit/sch/cmd-component-best-practices.sch

  • moved Schematron rules which are validate best practices

M toolkit/src/test/java/eu/clarin/cmd/toolkit/TestCMDToolkit.java

  • removed obsolete commented out code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • metadata/trunk/toolkit/src/main/resources/toolkit/downgrade/cmd-component-1_2-to-1_1.xsl

    r6904 r6907  
    88
    99    <xsl:param name="cmd-component-xsd" select="'http://infra.clarin.eu/cmd/general-component-schema.xsd'"/>
     10   
     11    <xsl:param name="escape" select="'ccmmddii_'"/>
    1012   
    1113    <!-- identity copy -->
     
    8082    <!-- turn Attribute child elements into attributes -->
    8183    <xsl:template match="Attribute" priority="1">
    82         <xsl:choose>
    83             <xsl:when test="exists(parent::AttributeList/parent::Component) and Name=('ref','ComponentId')">
    84                 <xsl:message>WRN: user-defined ref and ComponentId attributes for a Component are not supported by CMDI 1.1!</xsl:message>
    85             </xsl:when>
    86             <xsl:otherwise>
    87                 <Attribute>
    88                     <Name>
    89                         <xsl:value-of select="@name"/>
    90                     </Name>
    91                     <xsl:if test="normalize-space(@ConceptLink)!=''">
    92                         <ConceptLink>
    93                             <xsl:value-of select="@ConceptLink"/>
    94                         </ConceptLink>
    95                     </xsl:if>
    96                     <xsl:if test="normalize-space(@ValueScheme)!=''">
    97                         <Type>
    98                             <xsl:value-of select="@ValueScheme"/>
    99                         </Type>
    100                     </xsl:if>
    101                     <!-- @Required is skipped -->
    102                     <xsl:apply-templates select="node()"/>
    103                 </Attribute>
    104             </xsl:otherwise>
    105         </xsl:choose>
     84        <xsl:variable name="name">
     85            <xsl:choose>
     86                <xsl:when test="exists(parent::AttributeList/parent::Component) and Name=('ref','ComponentId')">
     87                    <xsl:message>WRN: user-defined ref and ComponentId attributes for a Component are not supported by CMDI 1.1! Adding the <xsl:value-of select="$escape"/> prefix</xsl:message>
     88                    <xsl:value-of select="concat($escape,@name)"/>
     89                </xsl:when>
     90                <xsl:otherwise>
     91                    <xsl:value-of select="@name"/>
     92                </xsl:otherwise>
     93            </xsl:choose>
     94        </xsl:variable>
     95        <Attribute>
     96            <Name>
     97                <xsl:value-of select="$name"/>
     98            </Name>
     99            <xsl:if test="normalize-space(@ConceptLink)!=''">
     100                <ConceptLink>
     101                    <xsl:value-of select="@ConceptLink"/>
     102                </ConceptLink>
     103            </xsl:if>
     104            <xsl:if test="normalize-space(@ValueScheme)!=''">
     105                <Type>
     106                    <xsl:value-of select="@ValueScheme"/>
     107                </Type>
     108            </xsl:if>
     109            <!-- @Required is skipped -->
     110            <xsl:apply-templates select="node()"/>
     111        </Attribute>
    106112    </xsl:template>
    107113   
Note: See TracChangeset for help on using the changeset viewer.