Index: metadata/trunk/toolkit/pom.xml
===================================================================
--- metadata/trunk/toolkit/pom.xml	(revision 6859)
+++ metadata/trunk/toolkit/pom.xml	(revision 6901)
@@ -33,5 +33,5 @@
             <id>cmdi.clarin.repository</id>
             <name>Clarin Repository</name>
-            <url>http://catalog.clarin.eu/ds/nexus/content/groups/public/</url>
+            <url>https://nexus.clarin.eu/content/repositories/Clarin</url>
         </repository>                                                    
     </repositories>
Index: metadata/trunk/toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd
===================================================================
--- metadata/trunk/toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd	(revision 6859)
+++ metadata/trunk/toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd	(revision 6901)
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-    $Revision$ 
-    $Date$ 
+<!--
+    $Revision$
+    $Date$
 -->
 
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://purl.oclc.org/dsdl/schematron"
     xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.0" vc:maxVersion="1.1">
-    
+
     <xs:import namespace="http://www.w3.org/XML/1998/namespace"
         schemaLocation="http://www.w3.org/2005/08/xml.xsd"/>
@@ -92,5 +92,5 @@
             <!-- from small (attribute) to big (component) -->
             <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1"/>
-            <xs:element name="Element" type="Element_type" minOccurs="0" maxOccurs="unbounded"/> 
+            <xs:element name="Element" type="Element_type" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="Component" type="Component_type" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
@@ -117,5 +117,5 @@
         </xs:simpleContent>
     </xs:complexType>
-    
+
     <xs:complexType name="Element_type">
         <xs:annotation>
@@ -205,10 +205,4 @@
                 <xs:annotation>
                     <xs:appinfo>
-                        <sch:pattern id="a_res">
-                            <sch:title>Check reserved attribute names</sch:title>
-                            <sch:rule context="Attribute">
-                                <sch:assert test="not(@name=('ref','ComponentId'))">Attribute name shouldn't be 'ref' or 'ComponentId', as these are used internally by CMD!</sch:assert>
-                            </sch:rule>
-                        </sch:pattern>
                         <sch:pattern id="a_sibs">
                             <sch:title>Check attribute siblings</sch:title>
@@ -273,5 +267,5 @@
         <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/1" processContents="lax"/>
     </xs:attributeGroup>
-    
+
     <xs:attributeGroup name="element_attributes">
         <xs:attribute name="name" type="xs:Name" use="required">
@@ -361,10 +355,10 @@
                         8    unbounded number    NOK
                         9    unbounded unbounded OK
-                        
+
                         UNK can be either a missing attribute or an empty value, both can be detected with normalize-space(@...)=''
-                        
+
                         default CardinalityMin is 1 (based on the XSD minOccurs default value)
                         default CardinalityMax is 1 (based on the XSD maxOccurs default value)
-                        
+
                         If a basic XSLT 2.0 engine, like Saxon HE, is used for Schematron validation we can't cast to xs:nonNegativeInteger.
                         So we cast to xs:integer. The XSD validator should have already validated that the values are valid cardinality_types.
@@ -455,5 +449,5 @@
                     </sch:rule>
                 </sch:pattern>
-            </xs:appinfo>            
+            </xs:appinfo>
         </xs:annotation>
         <xs:simpleContent>
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 6859)
+++ metadata/trunk/toolkit/src/test/java/eu/clarin/cmd/toolkit/TestCMDToolkit.java	(revision 6901)
@@ -47,6 +47,6 @@
     XsltTransformer upgradeCMDRec = null;
     XsltTransformer transformCMDSpecInXSD = null;
-    SchemAnon validateCMDSpec = null; 
-    SchemAnon validateCMDEnvelop = null; 
+    SchemAnon validateCMDSpec = null;
+    SchemAnon validateCMDEnvelop = null;
 
     @Before
@@ -56,6 +56,6 @@
             upgradeCMDRec = SaxonUtils.buildTransformer(CMDToolkit.class.getResource("/toolkit/upgrade/cmd-record-1_1-to-1_2.xsl")).load();
             transformCMDSpecInXSD = SaxonUtils.buildTransformer(CMDToolkit.class.getResource("/toolkit/xslt/comp2schema.xsl")).load();
-            validateCMDSpec = new SchemAnon(CMDToolkit.class.getResource("/toolkit/xsd/cmd-component.xsd").toURI().toURL()); 
-            validateCMDEnvelop = new SchemAnon(CMDToolkit.class.getResource("/toolkit/xsd/cmd-envelop.xsd").toURI().toURL()); 
+            validateCMDSpec = new SchemAnon(CMDToolkit.class.getResource("/toolkit/xsd/cmd-component.xsd").toURI().toURL());
+            validateCMDEnvelop = new SchemAnon(CMDToolkit.class.getResource("/toolkit/xsd/cmd-envelop.xsd").toURI().toURL());
         } catch(Exception e) {
             System.err.println("!ERR: couldn't setup the testing environment!");
@@ -68,5 +68,5 @@
     public void tearDown() {
     }
-    
+
     protected Document transform(XsltTransformer trans,Source src) throws Exception {
         try {
@@ -87,5 +87,5 @@
         }
     }
-    
+
     protected boolean xpath(Document doc,String xpath) throws Exception {
         XPathCompiler xpc   = SaxonUtils.getProcessor().newXPathCompiler();
@@ -96,5 +96,5 @@
         return xps.effectiveBooleanValue();
     }
-    
+
     protected void printMessages(SchemAnon anon) throws Exception {
         for (Message msg : anon.getMessages()) {
@@ -103,5 +103,5 @@
         }
     }
-    
+
     protected int countErrors(SchemAnon anon) throws Exception {
         int cnt = 0;
@@ -110,5 +110,5 @@
         return cnt;
     }
-    
+
     protected Document upgradeCMDSpec(String spec) throws Exception {
         System.out.println("Upgrade CMD spec["+spec+"]");
@@ -120,14 +120,14 @@
         return transform(upgradeCMDRec,new javax.xml.transform.stream.StreamSource(new java.io.File(TestCMDToolkit.class.getResource(rec).toURI())));
     }
-    
-    protected Document transformCMDSpecInXSD(String spec,Source src) throws Exception { 
+
+    protected Document transformCMDSpecInXSD(String spec,Source src) throws Exception {
         System.out.println("Transform CMD spec["+spec+"] into XSD");
         return transform(transformCMDSpecInXSD,src);
     }
-    
+
     protected Document transformCMDSpecInXSD(String spec) throws Exception {
         return transformCMDSpecInXSD(spec,new javax.xml.transform.stream.StreamSource(new java.io.File(TestCMDToolkit.class.getResource(spec).toURI())));
     }
-    
+
     protected boolean validateCMDSpec(String spec,Source src) throws Exception {
         System.out.println("Validate CMD spec["+spec+"]");
@@ -137,9 +137,9 @@
         return res;
     }
-    
+
     protected boolean validateCMDSpec(String spec) throws Exception {
         return validateCMDSpec(spec,new StreamSource(new java.io.File(TestCMDToolkit.class.getResource(spec).toURI())));
     }
-    
+
     protected boolean validateCMDRecord(String spec,SchemAnon anon,String rec,Source src) throws Exception {
         System.out.println("Validate CMD record["+rec+"] against spec["+spec+"]");
@@ -149,5 +149,5 @@
         return res;
     }
-    
+
     protected boolean validateCMDEnvelop(String rec,Source src) throws Exception {
         System.out.println("Validate envelop CMD rec["+rec+"]");
@@ -157,20 +157,20 @@
         return res;
     }
-    
+
     protected boolean validateCMDEnvelop(String rec) throws Exception {
         return validateCMDEnvelop(rec,new StreamSource(new java.io.File(TestCMDToolkit.class.getResource(rec).toURI())));
     }
-    
+
     @Test
     public void testAdelheid() throws Exception {
         String profile = "/toolkit/Adelheid/profiles/clarin.eu:cr1:p_1311927752306.xml";
         String record  = "/toolkit/Adelheid/records/Adelheid.cmdi";
-        
+
         // upgrade the profile from 1.1 to 1.2
         Document upgradedProfile = upgradeCMDSpec(profile);
-        
+
         // validate the 1.2 profile
         boolean validProfile = validateCMDSpec(profile+" (upgraded)",new DOMSource(upgradedProfile));
-        
+
         // assertions
         // the upgraded profile should be a valid CMDI 1.2 profile
@@ -178,15 +178,15 @@
         // so there should be no errors
         assertEquals(0, countErrors(validateCMDSpec));
-        
+
         // transform the 1.2 profile into a XSD
         Document profileSchema = transformCMDSpecInXSD(profile+" (upgraded)",new DOMSource(upgradedProfile));
         SchemAnon profileAnon = new SchemAnon(new DOMSource(profileSchema));
-        
+
         // upgrade the record from 1.1 to 1.2
         Document upgradedRecord = upgradeCMDRecord(record);
-        
+
         // validate the 1.2 record
         boolean validRecord = validateCMDRecord(profile+" (upgraded)",profileAnon,record+" (upgraded)",new DOMSource(upgradedRecord));
-        
+
         // assertions
         // the upgraded record should be a valid CMDI 1.2 record
@@ -200,8 +200,8 @@
         String profile = "/toolkit/Adelheid/profiles/clarin.eu:cr1:p_1311927752306_1_2.xml";
         String record  = "/toolkit/Adelheid/records/Adelheid_1_2-invalid.cmdi";
-        
+
         // validate the 1.2 profile
         boolean validProfile = validateCMDSpec(profile,new javax.xml.transform.stream.StreamSource(new java.io.File(TestCMDToolkit.class.getResource(profile).toURI())));
-        
+
         // assertions
         // the upgraded profile should be a valid CMDI 1.2 profile
@@ -209,11 +209,11 @@
         // so there should be no errors
         assertEquals(0, countErrors(validateCMDSpec));
-        
+
         Document profileSchema = transformCMDSpecInXSD(profile,new javax.xml.transform.stream.StreamSource(new java.io.File(TestCMDToolkit.class.getResource(profile).toURI())));
         SchemAnon profileAnon = new SchemAnon(new DOMSource(profileSchema));
-        
+
         // validate the 1.2 record
         boolean validRecord = validateCMDRecord(profile,profileAnon,record,new javax.xml.transform.stream.StreamSource(new java.io.File(TestCMDToolkit.class.getResource(record).toURI())));
-        
+
         // assertions
         // the record should be a invalid as it misses a the required CoreVersion attribute
@@ -222,4 +222,39 @@
 
     @Test
+    public void testSundhed() throws Exception {
+        String profile = "/toolkit/TEI/profiles/clarin.eu:cr1:p_1380106710826.xml";
+        String record  = "/toolkit/TEI/records/sundhed_dsn.teiHeader.ref.xml";
+
+        // upgrade the profile from 1.1 to 1.2
+        Document upgradedProfile = upgradeCMDSpec(profile);
+
+        // validate the 1.2 profile
+        boolean validProfile = validateCMDSpec(profile+" (upgraded)",new DOMSource(upgradedProfile));
+
+        // assertions
+        // the upgraded profile should be a valid CMDI 1.2 profile and 'ref' named Attributes should validate
+        assertTrue(validProfile);
+        // so there should be no errors
+        assertEquals(0, countErrors(validateCMDSpec));
+
+        // transform the 1.2 profile into a XSD
+        Document profileSchema = transformCMDSpecInXSD(profile+" (upgraded)",new DOMSource(upgradedProfile));
+        SchemAnon profileAnon = new SchemAnon(new DOMSource(profileSchema));
+
+        // upgrade the record from 1.1 to 1.2
+        Document upgradedRecord = upgradeCMDRecord(record);
+
+        // validate the 1.2 record
+        boolean validRecord = validateCMDRecord(profile+" (upgraded)", profileAnon, record+" (upgraded)", new DOMSource(upgradedRecord));
+
+        // assertions
+        // the upgraded record should be a valid CMDI 1.2 record
+        assertTrue(validRecord);
+
+        // so there should be no errors
+        assertEquals(0, countErrors(profileAnon));
+    }
+
+    @Test
     public void testTEI() throws Exception {
         String record  = "/toolkit/TEI/records/sundhed_dsn.teiHeader.ref.xml";
@@ -227,5 +262,5 @@
         // upgrade the record from 1.1 to 1.2
         Document upgradedRecord = upgradeCMDRecord(record);
-        
+
         // assertions
         // the @ref attributes on the elements should stay as they are
@@ -247,11 +282,11 @@
         String profile = "/toolkit/OLAC/profiles/OLAC-DcmiTerms.xml";
         String record  = "/toolkit/OLAC/records/org_rosettaproject-record.xml";
-        
+
         // upgrade the profile from 1.1 to 1.2
         Document upgradedProfile = upgradeCMDSpec(profile);
-        
+
         // validate the 1.2 profile
         boolean validProfile = validateCMDSpec(profile+" (upgraded)",new DOMSource(upgradedProfile));
-        
+
         // assertions
         // the upgraded profile should be a valid CMDI 1.2 profile
@@ -259,12 +294,12 @@
         // so there should be no errors
         assertEquals(0, countErrors(validateCMDSpec));
-        
+
         // transform the 1.2 profile into a XSD
         Document profileSchema = transformCMDSpecInXSD(profile+" (upgraded)",new DOMSource(upgradedProfile));
         SchemAnon profileAnon = new SchemAnon(new DOMSource(profileSchema));
-        
+
         // upgrade the record from 1.1 to 1.2
         Document upgradedRecord = upgradeCMDRecord(record);
-        
+
         // validate the 1.2 record
         boolean validRecord = validateCMDRecord(profile+" (upgraded)",profileAnon,record+" (upgraded)",new DOMSource(upgradedRecord));
@@ -284,3 +319,5 @@
         assertFalse(validProfile);
     }
+
+
 }
