Ignore:
Timestamp:
01/13/16 12:37:51 (8 years ago)
Author:
Menzo Windhouwer
Message:

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

  • added downgrade tests

M toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd

  • readded a_res Schematron rule to warn that @ref and @ComponentId? wont survive a downgrade to 1.1

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

  • fixes around Attributes
File:
1 edited

Legend:

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

    r6902 r6904  
    7373    </xsl:template>
    7474
    75     <!-- remove Vocabulary level -->
     75    <!-- remove Vocabulary level, incl. attributes -->
    7676    <xsl:template match="Vocabulary" priority="1">
    7777        <xsl:apply-templates select="node()"/>
     
    8080    <!-- turn Attribute child elements into attributes -->
    8181    <xsl:template match="Attribute" priority="1">
    82         <Attribute name="{Name}">
    83             <Name>
    84                 <xsl:value-of select="@name"/>
    85             </Name>
    86             <xsl:if test="normalize-space(@ValueScheme)!=''">
    87                 <Type>
    88                     <xsl:value-of select="@ValueScheme"/>
    89                 </Type>
    90             </xsl:if>
    91             <xsl:if test="normalize-space(@ConceptLink)!=''">
    92                 <ConceptLink>
    93                     <xsl:value-of select="@ConceptLink"/>
    94                 </ConceptLink>
    95             </xsl:if>
    96             <xsl:apply-templates select="node()"/>
    97         </Attribute>
     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>
    98106    </xsl:template>
    99107   
Note: See TracChangeset for help on using the changeset viewer.