Ignore:
Timestamp:
01/12/16 14:41:23 (9 years ago)
Author:
Mitchell Seaton
Message:

M pom.xml

  • updated repository url

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

  • Removed Schematron rule for Attribute name values not longer required due to 1.2 namespaces changes

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

  • Added unit test for CMDI profile schema containing 'ref' named Attributes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • metadata/trunk/toolkit/src/main/resources/toolkit/xsd/cmd-component.xsd

    r6859 r6901  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <!-- 
    3     $Revision$ 
    4     $Date$ 
     2<!--
     3    $Revision$
     4    $Date$
    55-->
    66
    77<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://purl.oclc.org/dsdl/schematron"
    88    xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.0" vc:maxVersion="1.1">
    9    
     9
    1010    <xs:import namespace="http://www.w3.org/XML/1998/namespace"
    1111        schemaLocation="http://www.w3.org/2005/08/xml.xsd"/>
     
    9292            <!-- from small (attribute) to big (component) -->
    9393            <xs:element name="AttributeList" type="AttributeList_type" minOccurs="0" maxOccurs="1"/>
    94             <xs:element name="Element" type="Element_type" minOccurs="0" maxOccurs="unbounded"/> 
     94            <xs:element name="Element" type="Element_type" minOccurs="0" maxOccurs="unbounded"/>
    9595            <xs:element name="Component" type="Component_type" minOccurs="0" maxOccurs="unbounded"/>
    9696        </xs:sequence>
     
    117117        </xs:simpleContent>
    118118    </xs:complexType>
    119    
     119
    120120    <xs:complexType name="Element_type">
    121121        <xs:annotation>
     
    205205                <xs:annotation>
    206206                    <xs:appinfo>
    207                         <sch:pattern id="a_res">
    208                             <sch:title>Check reserved attribute names</sch:title>
    209                             <sch:rule context="Attribute">
    210                                 <sch:assert test="not(@name=('ref','ComponentId'))">Attribute name shouldn't be 'ref' or 'ComponentId', as these are used internally by CMD!</sch:assert>
    211                             </sch:rule>
    212                         </sch:pattern>
    213207                        <sch:pattern id="a_sibs">
    214208                            <sch:title>Check attribute siblings</sch:title>
     
    273267        <xs:anyAttribute namespace="http://www.clarin.eu/cmdi/cues/1" processContents="lax"/>
    274268    </xs:attributeGroup>
    275    
     269
    276270    <xs:attributeGroup name="element_attributes">
    277271        <xs:attribute name="name" type="xs:Name" use="required">
     
    361355                        8    unbounded number    NOK
    362356                        9    unbounded unbounded OK
    363                        
     357
    364358                        UNK can be either a missing attribute or an empty value, both can be detected with normalize-space(@...)=''
    365                        
     359
    366360                        default CardinalityMin is 1 (based on the XSD minOccurs default value)
    367361                        default CardinalityMax is 1 (based on the XSD maxOccurs default value)
    368                        
     362
    369363                        If a basic XSLT 2.0 engine, like Saxon HE, is used for Schematron validation we can't cast to xs:nonNegativeInteger.
    370364                        So we cast to xs:integer. The XSD validator should have already validated that the values are valid cardinality_types.
     
    455449                    </sch:rule>
    456450                </sch:pattern>
    457             </xs:appinfo>           
     451            </xs:appinfo>
    458452        </xs:annotation>
    459453        <xs:simpleContent>
Note: See TracChangeset for help on using the changeset viewer.