Index: /metadata/trunk/toolkit/src/main/resources/toolkit/downgrade/cmd-component-1_2-to-1_1.xsl
===================================================================
--- /metadata/trunk/toolkit/src/main/resources/toolkit/downgrade/cmd-component-1_2-to-1_1.xsl	(revision 6906)
+++ /metadata/trunk/toolkit/src/main/resources/toolkit/downgrade/cmd-component-1_2-to-1_1.xsl	(revision 6907)
@@ -8,4 +8,6 @@
 
     <xsl:param name="cmd-component-xsd" select="'http://infra.clarin.eu/cmd/general-component-schema.xsd'"/>
+    
+    <xsl:param name="escape" select="'ccmmddii_'"/>
     
     <!-- identity copy -->
@@ -80,28 +82,32 @@
     <!-- turn Attribute child elements into attributes -->
     <xsl:template match="Attribute" priority="1">
-        <xsl:choose>
-            <xsl:when test="exists(parent::AttributeList/parent::Component) and Name=('ref','ComponentId')">
-                <xsl:message>WRN: user-defined ref and ComponentId attributes for a Component are not supported by CMDI 1.1!</xsl:message>
-            </xsl:when>
-            <xsl:otherwise>
-                <Attribute>
-                    <Name>
-                        <xsl:value-of select="@name"/>
-                    </Name>
-                    <xsl:if test="normalize-space(@ConceptLink)!=''">
-                        <ConceptLink>
-                            <xsl:value-of select="@ConceptLink"/>
-                        </ConceptLink>
-                    </xsl:if>
-                    <xsl:if test="normalize-space(@ValueScheme)!=''">
-                        <Type>
-                            <xsl:value-of select="@ValueScheme"/>
-                        </Type>
-                    </xsl:if>
-                    <!-- @Required is skipped -->
-                    <xsl:apply-templates select="node()"/>
-                </Attribute>
-            </xsl:otherwise>
-        </xsl:choose>
+        <xsl:variable name="name">
+            <xsl:choose>
+                <xsl:when test="exists(parent::AttributeList/parent::Component) and Name=('ref','ComponentId')">
+                    <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>
+                    <xsl:value-of select="concat($escape,@name)"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="@name"/>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <Attribute>
+            <Name>
+                <xsl:value-of select="$name"/>
+            </Name>
+            <xsl:if test="normalize-space(@ConceptLink)!=''">
+                <ConceptLink>
+                    <xsl:value-of select="@ConceptLink"/>
+                </ConceptLink>
+            </xsl:if>
+            <xsl:if test="normalize-space(@ValueScheme)!=''">
+                <Type>
+                    <xsl:value-of select="@ValueScheme"/>
+                </Type>
+            </xsl:if>
+            <!-- @Required is skipped -->
+            <xsl:apply-templates select="node()"/>
+        </Attribute>
     </xsl:template>
     
Index: /metadata/trunk/toolkit/src/main/resources/toolkit/sch/cmd-component-best-practices.sch
===================================================================
--- /metadata/trunk/toolkit/src/main/resources/toolkit/sch/cmd-component-best-practices.sch	(revision 6907)
+++ /metadata/trunk/toolkit/src/main/resources/toolkit/sch/cmd-component-best-practices.sch	(revision 6907)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+    <sch:ns uri="http://www.clarin.eu/cmd/" prefix="cmd"/>
+    <sch:ns uri="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi"/>
+ 
+    <sch:pattern id="c_nest">
+        <sch:title>Check nesting</sch:title>
+        <sch:rule context="Component[exists(Component|Element)]" role="warning">
+            <sch:assert test="empty((Component|Element)[@name=current()/@name])">A nested component or element has the same name ('<sch:value-of select="@name"/>') as this component! Please, consider to rename one of them.</sch:assert>
+        </sch:rule>
+    </sch:pattern>
+    
+</sch:schema>
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 6906)
+++ /metadata/trunk/toolkit/src/main/resources/toolkit/upgrade/cmd-record-1_1-to-1_2.xsl	(revision 6907)
@@ -12,10 +12,12 @@
     <xsl:param name="cmd-uri" select="'http://www.clarin.eu/cmd/1'"/>
     <xsl:param name="cr-uri" select="'..'"/>
+    <xsl:param name="cr-extension-xsd" select="'-1_2.xsd'"/>
+    <xsl:param name="cr-extension-xml" select="'.xml'"/>
+    
+    <xsl:param name="escape" select="'ccmmddii_'"/>
     
     <xsl:variable name="cmd-components" select="concat($cmd-uri,'/components')"/>
     <xsl:variable name="cmd-profiles" select="concat($cmd-uri,'/profiles')"/>
     <xsl:variable name="cr-profiles" select="concat($cr-uri,'/profiles')"/>
-    <xsl:variable name="cr-extension-xsd" select="'-1_2.xsd'"/>
-    <xsl:variable name="cr-extension-xml" select="'.xml'"/>
     
     <!-- identity copy -->
@@ -147,6 +149,11 @@
     </xsl:template>
     
+    <!-- unescape downgraded CMDI 1.2 attributes -->
+    <xsl:template match="cmd0:Components//@*[name()=local-name()][starts-with(name(),$escape)]">
+        <xsl:attribute name="{substring-after(name(),$escape)}" select="."/>
+    </xsl:template>
+    
     <!-- move CMD attributes to the CMD namespace -->
-    <xsl:template match="cmd0:Components//@ref">
+    <xsl:template match="cmd0:Components//@ref" priority="2">
         <xsl:choose>
             <xsl:when test="exists(parent::*/text()[normalize-space()!=''])">
@@ -158,5 +165,11 @@
                 <!-- 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:attribute name="cmd:ref">
+                    <xsl:variable name="refs" select="tokenize(.,'\s+')"/>
+                    <xsl:if test="count($refs) gt 1">
+                        <xsl:message>WRN: CMDI 1.2 doesn't support references to multiple ResourceProxies! Only the first reference is kept.</xsl:message>
+                    </xsl:if>
+                    <xsl:value-of select="$refs[1]"/>
+                </xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
@@ -175,5 +188,11 @@
                         <!-- 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:attribute name="cmd:ref">
+                            <xsl:variable name="refs" select="tokenize(.,'\s+')"/>
+                            <xsl:if test="count($refs) gt 1">
+                                <xsl:message>WRN: CMDI 1.2 doesn't support references to multiple ResourceProxies! Only the first reference is kept.</xsl:message>
+                            </xsl:if>
+                            <xsl:value-of select="$refs[1]"/>
+                        </xsl:attribute>
                     </xsl:otherwise>
                 </xsl:choose>
@@ -182,5 +201,5 @@
     </xsl:template>
     
-    <xsl:template match="cmd0:Components//@ComponentId">
+    <xsl:template match="cmd0:Components//@ComponentId" priority="2">
         <xsl:attribute name="cmd:ComponentId" select="."/>
     </xsl:template>
Index: /metadata/trunk/toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd
===================================================================
--- /metadata/trunk/toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd	(revision 6906)
+++ /metadata/trunk/toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd	(revision 6907)
@@ -80,10 +80,4 @@
                 </sch:pattern>
                 <!-- TODO: check: the names of referenced external components are not known, so we can't currently check if two or more of them use the same name -->
-                <sch:pattern id="c_nest">
-                    <sch:title>Check nesting</sch:title>
-                    <sch:rule context="Component[exists(Component|Element)]" role="warning">
-                        <sch:assert test="empty((Component|Element)[@name=current()/@name])">A nested component or element has the same name ('<sch:value-of select="@name"/>') as this component! Please, consider to rename one of them.</sch:assert>
-                    </sch:rule>
-                </sch:pattern>
             </xs:appinfo>
         </xs:annotation>
Index: /metadata/trunk/toolkit/src/test/java/eu/clarin/cmd/toolkit/TestCMDToolkit.java
===================================================================
--- /metadata/trunk/toolkit/src/test/java/eu/clarin/cmd/toolkit/TestCMDToolkit.java	(revision 6906)
+++ /metadata/trunk/toolkit/src/test/java/eu/clarin/cmd/toolkit/TestCMDToolkit.java	(revision 6907)
@@ -62,5 +62,4 @@
             validateCMDSpec = new SchemAnon(CMDToolkit.class.getResource("/toolkit/xsd/cmd-component.xsd").toURI().toURL());            
             validateCMDoldSpec = new SchemAnon(new URL("http://infra.clarin.eu/cmd/general-component-schema.xsd"));
-//            validateCMDoldSpec = new SchemAnon(new URL("file:///Users/menzowi/Documents/Projects/CLARIN/CMDI/CMDI-1.1/src/toolkit/general-component-schema.xsd"));
             validateCMDEnvelop = new SchemAnon(CMDToolkit.class.getResource("/toolkit/xsd/cmd-envelop.xsd").toURI().toURL());
         } catch(Exception e) {
