Changeset 6751


Ignore:
Timestamp:
11/06/15 09:49:45 (9 years ago)
Author:
Menzo Windhouwer
Message:

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

  • fixed ref lookup:

-- if a ref is declared, no namespace
-- if a ref is not declared add namespace

M toolkit/src/main/resources/toolkit/xslt/comp2schema.xsl

  • replaced dcr:datcat by cmd:ConceptLink
  • replaced ann:* by cmd:*
  • keep cue:* in the XSD
Location:
metadata/trunk/toolkit/src/main/resources/toolkit
Files:
2 edited

Legend:

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

    r6684 r6751  
    152152            <xsl:when test="exists(parent::*/text()[normalize-space()!=''])">
    153153                <!-- this is an element keep the @ref -->
     154                <!--<xsl:message>INF: this is an element keep the ref</xsl:message>-->
    154155                <xsl:copy/>
    155156            </xsl:when>
    156157            <xsl:when test="exists(../node()) or exists(parent::*/@ComponentId)">
    157158                <!-- the parent is a component add the namespace to @ref -->
     159                <!--<xsl:message>INF: this is an component add the namespace to ref</xsl:message>-->
    158160                <xsl:attribute name="cmd:ref" select="."/>
    159161            </xsl:when>
     
    165167                <xsl:variable name="attr" select="$prof//Attribute[Name='ref'][string-join(ancestor::*[local-name()=('CMD_Component','CMD_Element')]/@name,'/')=string-join($path/local-name(),'/')]"/>
    166168                <xsl:choose>
    167                     <xsl:when test="exists($attr/parent::AttributeList/parent::CMD_Component)">
    168                         <!-- the parent is a component add the namespace to @ref -->
    169                         <xsl:attribute name="cmd:ref" select="."/>
     169                    <xsl:when test="exists($attr)">
     170                        <!-- in CMDI 1.1 @ref can only be an user declared attribute for an element -->
     171                        <!--<xsl:message>INF: according to the profile this @ref is an user declared attribute, so keep the ref</xsl:message>-->
     172                        <xsl:copy/>
    170173                    </xsl:when>
    171174                    <xsl:otherwise>
    172                         <!-- this is an element keep the @ref -->
    173                         <xsl:copy/>
     175                        <!-- this is an undeclared @ref, so add the namespace -->
     176                        <!--<xsl:message>INF: according to the profile this @ref is not user defined, so add the namespace</xsl:message>-->
     177                        <xsl:attribute name="cmd:ref" select="."/>
    174178                    </xsl:otherwise>
    175179                </xsl:choose>
  • metadata/trunk/toolkit/src/main/resources/toolkit/xslt/comp2schema.xsl

    r6255 r6751  
    66-->
    77
    8 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dcr="http://www.isocat.org/ns/dcr" xmlns:ann="http://www.clarin.eu" xmlns:cmd="http://www.clarin.eu/cmd/1" xmlns:cue="http://www.clarin.eu/cmdi/cues/display/1.0">
     8<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cmd="http://www.clarin.eu/cmd/1" xmlns:cue="http://www.clarin.eu/cmdi/cues/display/1.0">
    99
    1010    <xsl:param name="cmd-toolkit" select="'../../../../../main/resources/toolkit'"/>
     
    8181
    8282    <xsl:template match="*" mode="Header">
    83         <xsl:element name="ann:{name()}" namespace="http://www.clarin.eu">
     83        <xsl:element name="cmd:{name()}">
    8484            <xsl:value-of select="text()"/>
    8585            <xsl:apply-templates select="*" mode="Header"/>
     
    301301        <xs:attribute name="{@name}">
    302302
    303             <!-- Add a dcr:datcat if a ConceptLink element is found -->
     303            <!-- Add a cmd:ConceptLink if a ConceptLink element is found -->
    304304            <xsl:if test="normalize-space(@ConceptLink)!=''">
    305                 <xsl:attribute name="dcr:datcat">
     305                <xsl:attribute name="cmd:ConceptLink">
    306306                    <xsl:value-of select="@ConceptLink"/>
    307307                </xsl:attribute>
     
    404404    <!-- end multilinguality part -->
    405405
    406     <!-- Add a @dcr:datcat if a ConceptLink attribute is found -->
     406    <!-- Add a @cmd:ConceptLink if a ConceptLink attribute is found -->
    407407    <xsl:template match="@ConceptLink">
    408         <xsl:attribute name="dcr:datcat">
     408        <xsl:attribute name="cmd:ConceptLink">
    409409            <xsl:value-of select="."/>
    410410        </xsl:attribute>
     
    412412
    413413    <xsl:template match="@AppInfo">
    414         <xsl:attribute name="ann:label">
     414        <xsl:attribute name="cmd:label">
    415415            <xsl:value-of select="."/>
    416416        </xsl:attribute>
     
    424424   
    425425    <xsl:template match="Vocabulary/@URI">
    426         <xsl:attribute name="ann:Vocabulary">
     426        <xsl:attribute name="cmd:Vocabulary">
    427427            <xsl:value-of select="."/>
    428428        </xsl:attribute>
     
    430430
    431431    <xsl:template match="@ValueProperty|@ValueLanguage">
    432         <xsl:attribute name="ann:{local-name()}">
     432        <xsl:attribute name="cmd:{local-name()}">
    433433            <xsl:value-of select="."/>
    434434        </xsl:attribute>
     
    443443
    444444    <xsl:template match="@AutoValue">
    445         <xsl:attribute name="ann:AutoValue">
     445        <xsl:attribute name="cmd:AutoValue">
    446446            <xsl:value-of select="."/>
    447447        </xsl:attribute>
     
    449449   
    450450    <xsl:template match="@cue:DisplayPriority" priority="1">
    451         <xsl:attribute name="ann:displaypriority">
     451        <xsl:attribute name="cue:displaypriority">
    452452            <xsl:value-of select="."/>
    453453        </xsl:attribute>
     
    455455
    456456    <xsl:template match="@cue:*">
    457         <xsl:attribute name="ann:{local-name()}">
     457        <xsl:attribute name="cue:{local-name()}">
    458458            <xsl:value-of select="."/>
    459459        </xsl:attribute>
Note: See TracChangeset for help on using the changeset viewer.