Index: metadata/trunk/toolkit/src/main/resources/toolkit/upgrade/cmd-record-1_1-to-1_2.xsl
===================================================================
--- metadata/trunk/toolkit/src/main/resources/toolkit/upgrade/cmd-record-1_1-to-1_2.xsl	(revision 6684)
+++ metadata/trunk/toolkit/src/main/resources/toolkit/upgrade/cmd-record-1_1-to-1_2.xsl	(revision 6751)
@@ -152,8 +152,10 @@
             <xsl:when test="exists(parent::*/text()[normalize-space()!=''])">
                 <!-- this is an element keep the @ref -->
+                <!--<xsl:message>INF: this is an element keep the ref</xsl:message>-->
                 <xsl:copy/>
             </xsl:when>
             <xsl:when test="exists(../node()) or exists(parent::*/@ComponentId)">
                 <!-- the parent is a component add the namespace to @ref -->
+                <!--<xsl:message>INF: this is an component add the namespace to ref</xsl:message>-->
                 <xsl:attribute name="cmd:ref" select="."/>
             </xsl:when>
@@ -165,11 +167,13 @@
                 <xsl:variable name="attr" select="$prof//Attribute[Name='ref'][string-join(ancestor::*[local-name()=('CMD_Component','CMD_Element')]/@name,'/')=string-join($path/local-name(),'/')]"/>
                 <xsl:choose>
-                    <xsl:when test="exists($attr/parent::AttributeList/parent::CMD_Component)">
-                        <!-- the parent is a component add the namespace to @ref -->
-                        <xsl:attribute name="cmd:ref" select="."/>
+                    <xsl:when test="exists($attr)">
+                        <!-- in CMDI 1.1 @ref can only be an user declared attribute for an element -->
+                        <!--<xsl:message>INF: according to the profile this @ref is an user declared attribute, so keep the ref</xsl:message>-->
+                        <xsl:copy/>
                     </xsl:when>
                     <xsl:otherwise>
-                        <!-- this is an element keep the @ref -->
-                        <xsl:copy/>
+                        <!-- this is an undeclared @ref, so add the namespace -->
+                        <!--<xsl:message>INF: according to the profile this @ref is not user defined, so add the namespace</xsl:message>-->
+                        <xsl:attribute name="cmd:ref" select="."/>
                     </xsl:otherwise>
                 </xsl:choose>
Index: metadata/trunk/toolkit/src/main/resources/toolkit/xslt/comp2schema.xsl
===================================================================
--- metadata/trunk/toolkit/src/main/resources/toolkit/xslt/comp2schema.xsl	(revision 6684)
+++ metadata/trunk/toolkit/src/main/resources/toolkit/xslt/comp2schema.xsl	(revision 6751)
@@ -6,5 +6,5 @@
 -->
 
-<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">
+<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">
 
     <xsl:param name="cmd-toolkit" select="'../../../../../main/resources/toolkit'"/>
@@ -81,5 +81,5 @@
 
     <xsl:template match="*" mode="Header">
-        <xsl:element name="ann:{name()}" namespace="http://www.clarin.eu">
+        <xsl:element name="cmd:{name()}">
             <xsl:value-of select="text()"/>
             <xsl:apply-templates select="*" mode="Header"/>
@@ -301,7 +301,7 @@
         <xs:attribute name="{@name}">
 
-            <!-- Add a dcr:datcat if a ConceptLink element is found -->
+            <!-- Add a cmd:ConceptLink if a ConceptLink element is found -->
             <xsl:if test="normalize-space(@ConceptLink)!=''">
-                <xsl:attribute name="dcr:datcat">
+                <xsl:attribute name="cmd:ConceptLink">
                     <xsl:value-of select="@ConceptLink"/>
                 </xsl:attribute>
@@ -404,7 +404,7 @@
     <!-- end multilinguality part -->
 
-    <!-- Add a @dcr:datcat if a ConceptLink attribute is found -->
+    <!-- Add a @cmd:ConceptLink if a ConceptLink attribute is found -->
     <xsl:template match="@ConceptLink">
-        <xsl:attribute name="dcr:datcat">
+        <xsl:attribute name="cmd:ConceptLink">
             <xsl:value-of select="."/>
         </xsl:attribute>
@@ -412,5 +412,5 @@
 
     <xsl:template match="@AppInfo">
-        <xsl:attribute name="ann:label">
+        <xsl:attribute name="cmd:label">
             <xsl:value-of select="."/>
         </xsl:attribute>
@@ -424,5 +424,5 @@
     
     <xsl:template match="Vocabulary/@URI">
-        <xsl:attribute name="ann:Vocabulary">
+        <xsl:attribute name="cmd:Vocabulary">
             <xsl:value-of select="."/>
         </xsl:attribute>
@@ -430,5 +430,5 @@
 
     <xsl:template match="@ValueProperty|@ValueLanguage">
-        <xsl:attribute name="ann:{local-name()}">
+        <xsl:attribute name="cmd:{local-name()}">
             <xsl:value-of select="."/>
         </xsl:attribute>
@@ -443,5 +443,5 @@
 
     <xsl:template match="@AutoValue">
-        <xsl:attribute name="ann:AutoValue">
+        <xsl:attribute name="cmd:AutoValue">
             <xsl:value-of select="."/>
         </xsl:attribute>
@@ -449,5 +449,5 @@
     
     <xsl:template match="@cue:DisplayPriority" priority="1">
-        <xsl:attribute name="ann:displaypriority">
+        <xsl:attribute name="cue:displaypriority">
             <xsl:value-of select="."/>
         </xsl:attribute>
@@ -455,5 +455,5 @@
 
     <xsl:template match="@cue:*">
-        <xsl:attribute name="ann:{local-name()}">
+        <xsl:attribute name="cue:{local-name()}">
             <xsl:value-of select="."/>
         </xsl:attribute>
