
-- CDDL HEADER START

-- The contents of this file are subject to the terms of the
-- Common Development and Distribution License, Version 1.0 only
-- (the "License"). You may not use this file except in compliance
-- with the License.

-- You can obtain a copy of the license at license/ESCIDOC.LICENSE
-- or http://www.escidoc.de/license.
-- See the License for the specific language governing permissions
-- and limitations under the License.

-- When distributing Covered Code, include this CDDL HEADER in each
-- file and include the License file at license/ESCIDOC.LICENSE.
-- If applicable, add the following below this CDDL HEADER, with the
-- fields enclosed by brackets "[]" replaced with your own identifying
-- information: Portions Copyright [yyyy] [name of copyright owner]

-- CDDL HEADER END


-- Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
-- für wissenschaftlich-technische Information mbH and Max-Planck-
-- Gesellschaft zur Förderung der Wissenschaft e.V.
-- All rights reserved. Use is subject to license terms.

--
--

-- Started on 2007-11-12 11:57:56

--
-- TOC entry 1621 (class 0 OID 36425)
-- Dependencies: 1285
-- Data for Name: escidoc_validation_schema; Type: TABLE DATA; Schema: public; Owner: validator
--

INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:150', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:150" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
	<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
	<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
	<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
	<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="publication:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="publication:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/escidoc:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/escidoc:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:138', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:138" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
	<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
	<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
	<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
	<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="publication:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="publication:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:142', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:142" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
	<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
	<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
	<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
	<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:130', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:130" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
	<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
	<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
	<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
	<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:122', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:122" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
	<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
	<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
	<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
	<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:126', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:126" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
	<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
	<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
	<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
	<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:134', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:134" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
	<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
	<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
	<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
	<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:146', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:146" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
	<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
	<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
	<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
	<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title !='''' ">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:persistent23', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $
 -->
<?identification content-model="escidoc:persistent4" context="escidoc:persistent23" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>
	
	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_modified_required"/>
		<iso:active pattern="abstract_english_required"/>
		<iso:active pattern="public_file_required"/>
		<iso:active pattern="event_required"/>
		<iso:active pattern="review_method_internal_required"/>
	</iso:phase>


	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- Genre must not be one of Proceedings, Conference Paper, Talk at event, Conference Report, Poster, Courseware/Lecture, Thesis, Paper, Report, Other. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type = ''Proceedings'' or @type = ''Conference Paper'' or @type = ''Talk at event'' or @type = ''Conference Report'' or @type = ''Poster'' or @type = ''Courseware/Lecture'' or @type = ''Thesis'' or @type = ''Paper'' or @type = ''Report'' or @type = ''Other''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- At least one creator of role "author" is MPDL (organization) or is affiliated to MPDL (person). -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != '''' ">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role = ''author''">AuthorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]">MpdlCreatorRequired</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- One date of type "modified" has to be provided and it''s value is after 2007-01-01. -->
	<iso:pattern name="date_modified_required" id="date_modified_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')">DateModifiedNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- An abstract of language "English" has to be provided. -->
	<iso:pattern name="abstract_english_required" id="abstract_english_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dcterms:abstract[@xml:lang=''en'']">EnglishAbstractNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one file with visibility "public" has been uploaded for the item. -->
	<iso:pattern name="public_file_required" id="public_file_required">
		<iso:rule context="escidocComponents:components">
			<iso:assert test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''">NoPublicFileProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Proceedings", "Conference Paper", "Talk at event", "Conference Report" or "Courseware/Lecture", an event has to be provided. -->
	<iso:pattern name="event_required" id="event_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')">EventNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- The ReviewMethod has the value "internal".  -->
	<iso:pattern name="review_method_internal_required" id="review_method_internal_required">
		<iso:rule context="publication:publication">
			<iso:assert test="publication:review-method = ''internal''">ReviewMethodInternalNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:140', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:140" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:136', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:136" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:148', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:148" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:128', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:128" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:124', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:124" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:120', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:120" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:144', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:144" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:132', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:132" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');
INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, id_metadata_version_ref, creator_ref, date_created, date_last_modified, date_last_refreshed, schema_content, current_version) VALUES ('escidoc:persistent4', 'escidoc:persistent3', '1.0', NULL, NULL, NULL, NULL, '<?xml version="1.0" encoding="UTF-8"?>
<!--
 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License"). You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at license/ESCIDOC.LICENSE
 or http://www.escidoc.de/license.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at license/ESCIDOC.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END


 Copyright 2006-2010 Fachinformationszentrum Karlsruhe Gesellschaft
 für wissenschaftlich-technische Information mbH and Max-Planck-
 Gesellschaft zur Förderung der Wissenschaft e.V.
 All rights reserved. Use is subject to license terms.
-->
<!-- Validation Schema for publication items
	$Author: mfranke $
	$Revision: 120 $ -->
<?identification content-model="escidoc:persistent4" context="escidoc:persistent3" metadata-version="1.0" version="0.1"?>

<iso:schema xmlns:iso="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" schemaVersion="ISO19757-3" defaultPhase="default">
	
	<iso:ns prefix="item" uri="http://www.escidoc.de/schemas/item/0.3"/>
	<iso:ns prefix="escidocMetadataRecords" uri="http://www.escidoc.de/schemas/metadatarecords/0.3"/>
	<iso:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
	<iso:ns prefix="dcterms" uri="http://purl.org/dc/terms/"/>
	<iso:ns prefix="escidocMetadataProfile" uri="http://escidoc.mpg.de/metadataprofile/schema/0.1/"/>
	<iso:ns prefix="escidoc" uri="http://purl.org/escidoc/metadata/terms/0.1/"/>
	<iso:ns prefix="escidocComponents" uri="http://www.escidoc.de/schemas/item/0.3/components"/>
	<iso:ns prefix="publication" uri="http://purl.org/escidoc/metadata/profiles/0.1/publication"/>
<iso:ns prefix="person" uri="http://purl.org/escidoc/metadata/profiles/0.1/person"/>
<iso:ns prefix="source" uri="http://purl.org/escidoc/metadata/profiles/0.1/source"/>
<iso:ns prefix="event" uri="http://purl.org/escidoc/metadata/profiles/0.1/event"/>
<iso:ns prefix="organization" uri="http://purl.org/escidoc/metadata/profiles/0.1/organization"/>
	<iso:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
	
	<!-- Validation points -->
	<iso:phase id="default">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
	</iso:phase>

	<iso:phase id="submit_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<iso:phase id="accept_item">
		<iso:active pattern="publisher_name_required"/>
		<iso:active pattern="organization_name_required"/>
		<iso:active pattern="event_title_required"/>
		<iso:active pattern="source_title_required"/>
		<iso:active pattern="creator_role_required"/>
		<iso:active pattern="genre_required"/>
		<iso:active pattern="title_required"/>
		<iso:active pattern="creator_required"/>
		<iso:active pattern="correct_date_format"/>
		<iso:active pattern="component_data_required"/>
		
		<iso:active pattern="date_required"/>
		<iso:active pattern="source_required"/>
		<iso:active pattern="review_method_required"/>
	</iso:phase>

	<!-- Validation rules -->
	
	<!-- Default rules -->
	 
	 <!-- if any fields at "Event" are filled, "Title" of the event has to be filled also. -->
	<iso:pattern name="event_title_required" id="event_title_required">
		<iso:rule context="event:event">
			<iso:assert test="dc:title != '''' or not(* != '''' or @xml:lang != '''')">EventTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "Source" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="source_title_required" id="source_title_required">
		<iso:rule context="source:source">
			<iso:assert test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')">SourceTitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	 <!-- if any fields at "P" are filled, "Title" of the source has to be filled also. -->
	<iso:pattern name="creator_role_required" id="creator_role_required">
		<iso:rule context="source:source">
			<iso:assert test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')">SourceCreatorRoleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Entered dates have to be in the format YYYY, YYYY-MM or YYYY-MM-DD -->
	<iso:pattern name="correct_date_format" id="correct_date_format">
		<!-- Publication dates -->
		<iso:rule context="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<!-- Event dates -->
		<iso:rule context="escidoc:start-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
		</iso:rule>
		<iso:rule context="escidoc:end-date">
			<iso:assert test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)">DateFormatIncorrect</iso:assert>
			<iso:assert test=". = '''' or ../escidoc:start-date != ''''">EndDateWithoutStartDate</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a file is given, the filename is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''">ComponentFileNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the content type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''">ComponentContentCategoryNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the mime type is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''">ComponentMimeTypeNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If a file is given, the visibility is mandatory. -->
	<iso:pattern name="component_data_required" id="component_data_required">
		<iso:rule context="escidocComponents:component">
			<iso:assert test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''">ComponentVisibilityNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- Validation point specific -->	
	
	<!-- Title is required -->
	<iso:pattern name="title_required" id="title_required">
		<iso:rule context="publication:publication">
			<iso:assert test="dc:title != ''''">TitleNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre is required -->
	<iso:pattern name="genre_required" id="genre_required">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''''">GenreNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- Genre must not be manuscript. -->
	<iso:pattern name="genre_constraint" id="genre_constraint">
		<iso:rule context="publication:publication">
			<iso:assert test="@type != ''manuscript''">GenreNotSuitable</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- At least one creator with an organizational unit provided is required -->
	<iso:pattern name="creator_required" id="creator_required">
		<iso:rule context="publication:publication">
			<iso:assert test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title != ''''">CreatorNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/@role != ''''">CreatorRoleNotProvided</iso:assert>
			<iso:assert test="escidoc:creator/person:person/organization:organization/dc:title != '''' or escidoc:creator/organization:organization/dc:title != ''''">OrganizationalMetadataNotProvided</iso:assert>
		</iso:rule>
		<iso:rule context="publication:publication/escidoc:creator/person:person">
			<iso:assert test="escidoc:family-name != ''''">CreatorFamilyNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- if "Publisher place" or "Publisher edition" is filled, "Publisher name" has to be filled also -->
	<iso:pattern name="publisher_name_required" id="publisher_name_required">
		<iso:rule context="escidoc:publishing-info">
			<iso:assert test="dc:publisher != '''' or not(* != '''')">PublisherNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	 
	<!-- if the field "Address of an Organization" within a creator of type "Person" is filled, "Name of the Organization" has to be filled also. -->
	<iso:pattern name="organization_name_required" id="organization_name_required">
		<iso:rule context="organization:organization">
			<iso:assert test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''">OrganizationNameNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

	<!-- If genre is not equal to "Series" or "Journal" or "Other" or "Manuscript" at least one date has to be provided -->
	<iso:pattern name="date_required" id="date_required">
		<iso:rule context="publication:publication">
			<iso:assert test="(@type = ''series'' or @type = ''journal'' or @type = ''manuscript'' or @type = ''other'') or ((dcterms:created != '''') or (dcterms:modified != '''') or (dcterms:dateSubmitted != '''') or (dcterms:dateAccepted != '''') or (dcterms:issued != ''''))">DateNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If genre is equal to "Article", "Book Chapter" or "Conference Paper" at least one source has to be provided -->
	<iso:pattern name="source_required" id="source_required" flag="restrictive">
		<iso:rule context="publication:publication">
			<iso:assert test="not(@type = ''article'' or @type = ''book-item'' or @type = ''conference-paper'') or (source:source/dc:title != '''')">SourceNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>
	
	<!-- If a date of type "dcterms:dateIssued" is given, the ReviewType has to be provided -->
	<iso:pattern name="review_method_required" id="review_method_required">
		<iso:rule context="publication:publication">
			<iso:assert test="not(dcterms:issued != '''') or (publication:review-method != '''')">ReviewMethodNotProvided</iso:assert>
		</iso:rule>
	</iso:pattern>

</iso:schema>
', '1.0');


--
-- TOC entry 1620 (class 0 OID 36418)
-- Dependencies: 1284
-- Data for Name: escidoc_validation_schema_snippets; Type: TABLE DATA; Schema: public; Owner: validator
--

INSERT INTO escidoc_validation_schema_snippets (id_context_ref, id_content_type_ref, id_validation_point, id_metadata_version_ref, snippet_content) VALUES ('escidoc:150', 'escidoc:persistent4', 'default', '2.0', '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:sch="http://www.ascc.net/xml/schematron"
                xmlns:iso="http://purl.oclc.org/dsdl/schematron"
                xmlns:item="http://www.escidoc.de/schemas/item/0.3"
                xmlns:escidocMetadataRecords="http://www.escidoc.de/schemas/metadatarecords/0.3"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:dcterms="http://purl.org/dc/terms/"
                xmlns:escidocMetadataProfile="http://escidoc.mpg.de/metadataprofile/schema/0.1/"
                 xmlns:escidoc="http://purl.org/escidoc/metadata/terms/0.1/"
				xmlns:escidocComponents="http://www.escidoc.de/schemas/item/0.3/components"
				xmlns:publication="http://purl.org/escidoc/metadata/profiles/0.1/publication"
				xmlns:person="http://purl.org/escidoc/metadata/profiles/0.1/person"
				xmlns:source="http://purl.org/escidoc/metadata/profiles/0.1/source"
				xmlns:event="http://purl.org/escidoc/metadata/profiles/0.1/event"
				xmlns:organization="http://purl.org/escidoc/metadata/profiles/0.1/organization"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is 
    the preferred method for meta-stylesheets to use where possible. The name or details of 
    this mode may change during 1Q 2007.-->


<!--PHASES-->


<!--PROLOG-->


<!--KEYS-->


<!--DEFAULT RULES-->


<!--MODE: SCHEMATRON-FULL-PATH-->
<!--This mode can be used to generate an ugly though full XPath for locators-->
<xsl:template match="*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">
            <xsl:value-of select="name()"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:text>*:</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>[namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:variable name="preceding"
                    select="count(preceding-sibling::*[local-name()=local-name(current())and namespace-uri() = namespace-uri(current())])"/>
      <xsl:text>[</xsl:text>
      <xsl:value-of select="1+ $preceding"/>
      <xsl:text>]</xsl:text>
   </xsl:template>
   <xsl:template match="@*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">@iso:schema</xsl:when>
         <xsl:otherwise>
            <xsl:text>@*[local-name()=''</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>'' and namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: SCHEMATRON-FULL-PATH-2-->
<!--This mode can be used to generate prefixed XPath for humans-->
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
      <xsl:for-each select="ancestor-or-self::*">
         <xsl:text>/</xsl:text>
         <xsl:value-of select="name(.)"/>
         <xsl:if test="preceding-sibling::*[name(.)=name(current())]">
            <xsl:text>[</xsl:text>
            <xsl:value-of/>
            <xsl:text>]</xsl:text>
         </xsl:if>
      </xsl:for-each>
      <xsl:if test="not(self::*)">
         <xsl:text/>/@<xsl:value-of select="name(.)"/>
      </xsl:if>
   </xsl:template>

   <!--MODE: GENERATE-ID-FROM-PATH -->
<xsl:template match="/" mode="generate-id-from-path"/>
   <xsl:template match="text()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.text-'', 1+count(preceding-sibling::text()), ''-'')"/>
   </xsl:template>
   <xsl:template match="comment()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.comment-'', 1+count(preceding-sibling::comment()), ''-'')"/>
   </xsl:template>
   <xsl:template match="processing-instruction()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.processing-instruction-'', 1+count(preceding-sibling::processing-instruction()), ''-'')"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.@'', name())"/>
   </xsl:template>
   <xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:text>.</xsl:text>
      <xsl:choose>
         <xsl:when test="count(. | ../namespace::*) = count(../namespace::*)">
            <xsl:value-of select="concat(''.namespace::-'',1+count(namespace::*),''-'')"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:value-of select="concat(''.'',name(),''-'',1+count(preceding-sibling::*[name()=name(current())]),''-'')"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: GENERATE-ID-2 -->
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
   <xsl:template match="*" mode="generate-id-2" priority="2">
      <xsl:text>U</xsl:text>
      <xsl:number level="multiple" count="*"/>
   </xsl:template>
   <xsl:template match="node()" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>n</xsl:text>
      <xsl:number count="node()"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="string-length(local-name(.))"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="translate(name(),'':'',''.'')"/>
   </xsl:template>
   <!--Strip characters--><xsl:template match="text()" priority="-1"/>

   <!--SCHEMA METADATA-->
<xsl:template match="/">
      <validation-report phase="default">

         <pattern>event_title_required</pattern>
         <xsl:apply-templates select="/" mode="M12"/>
         <pattern>source_title_required</pattern>
         <xsl:apply-templates select="/" mode="M13"/>
         <pattern>creator_role_required</pattern>
         <xsl:apply-templates select="/" mode="M14"/>
         <pattern>correct_date_format</pattern>
         <xsl:apply-templates select="/" mode="M15"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M16"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M17"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M18"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M19"/>
         <pattern>title_required</pattern>
         <xsl:apply-templates select="/" mode="M20"/>
         <pattern>genre_required</pattern>
         <xsl:apply-templates select="/" mode="M21"/>
         <pattern>publisher_name_required</pattern>
         <xsl:apply-templates select="/" mode="M22"/>
         <pattern>organization_name_required</pattern>
         <xsl:apply-templates select="/" mode="M23"/>
         <pattern>creator_required</pattern>
         <xsl:apply-templates select="/" mode="M25"/>
      </validation-report>
   </xsl:template>

   <!--SCHEMATRON PATTERNS-->


<!--PATTERN event_title_required-->


	<!--RULE -->
<xsl:template match="event:event" priority="4000" mode="M12">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(* != '''' or @xml:lang != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EventTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M12"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M12"/>
   <xsl:template match="@*|node()" priority="-2" mode="M12">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M12"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M12"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN source_title_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M13">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M13"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M13"/>
   <xsl:template match="@*|node()" priority="-2" mode="M13">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M13"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M13"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_role_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M14">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceCreatorRoleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M14"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M14"/>
   <xsl:template match="@*|node()" priority="-2" mode="M14">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M14"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M14"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN correct_date_format-->


	<!--RULE -->
<xsl:template match="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted"
                 priority="4000"
                 mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:start-date" priority="3999" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:end-date" priority="3998" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or ../escidoc:start-date != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EndDateWithoutStartDate</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M15"/>
   <xsl:template match="@*|node()" priority="-2" mode="M15">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M15"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M15"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M16">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentFileNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M16"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M16"/>
   <xsl:template match="@*|node()" priority="-2" mode="M16">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M16"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M16"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M17">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentContentCategoryNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M17"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M17"/>
   <xsl:template match="@*|node()" priority="-2" mode="M17">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M17"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M17"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M18">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentMimeTypeNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M18"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M18"/>
   <xsl:template match="@*|node()" priority="-2" mode="M18">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M18"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M18"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M19">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentVisibilityNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M19"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M19"/>
   <xsl:template match="@*|node()" priority="-2" mode="M19">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M19"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M19"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN title_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M20">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>TitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M20"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M20"/>
   <xsl:template match="@*|node()" priority="-2" mode="M20">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M20"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M20"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN genre_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M21">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="@type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>GenreNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M21"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M21"/>
   <xsl:template match="@*|node()" priority="-2" mode="M21">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M21"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M21"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN publisher_name_required-->


	<!--RULE -->
<xsl:template match="escidoc:publishing-info" priority="4000" mode="M22">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:publisher != '''' or not(* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>PublisherNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M22"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M22"/>
   <xsl:template match="@*|node()" priority="-2" mode="M22">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M22"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M22"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN organization_name_required-->


	<!--RULE -->
<xsl:template match="organization:organization" priority="4000" mode="M23">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>OrganizationNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M23"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M23"/>
   <xsl:template match="@*|node()" priority="-2" mode="M23">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M23"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M23"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title !='''' "/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role = ''author''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>AuthorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>MpdlCreatorRequired</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="publication:publication/escidoc:creator/person:person"
                 priority="3999"
                 mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:family-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorFamilyNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M25"/>
   <xsl:template match="@*|node()" priority="-2" mode="M25">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M25"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M25"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
</xsl:stylesheet>');
INSERT INTO escidoc_validation_schema_snippets (id_context_ref, id_content_type_ref, id_validation_point, id_metadata_version_ref, snippet_content) VALUES ('escidoc:150', 'escidoc:persistent4', 'submit_item', '2.0', '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:sch="http://www.ascc.net/xml/schematron"
                xmlns:iso="http://purl.oclc.org/dsdl/schematron"
                xmlns:item="http://www.escidoc.de/schemas/item/0.3"
                xmlns:escidocMetadataRecords="http://www.escidoc.de/schemas/metadatarecords/0.3"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:dcterms="http://purl.org/dc/terms/"
                xmlns:escidocMetadataProfile="http://escidoc.mpg.de/metadataprofile/schema/0.1/"
                xmlns:escidoc="http://purl.org/escidoc/metadata/terms/0.1/"
				xmlns:escidocComponents="http://www.escidoc.de/schemas/item/0.3/components"
				xmlns:publication="http://purl.org/escidoc/metadata/profiles/0.1/publication"
				xmlns:person="http://purl.org/escidoc/metadata/profiles/0.1/person"
				xmlns:source="http://purl.org/escidoc/metadata/profiles/0.1/source"
				xmlns:event="http://purl.org/escidoc/metadata/profiles/0.1/event"
				xmlns:organization="http://purl.org/escidoc/metadata/profiles/0.1/organization"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is 
    the preferred method for meta-stylesheets to use where possible. The name or details of 
    this mode may change during 1Q 2007.-->


<!--PHASES-->


<!--PROLOG-->


<!--KEYS-->


<!--DEFAULT RULES-->


<!--MODE: SCHEMATRON-FULL-PATH-->
<!--This mode can be used to generate an ugly though full XPath for locators-->
<xsl:template match="*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">
            <xsl:value-of select="name()"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:text>*:</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>[namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:variable name="preceding"
                    select="count(preceding-sibling::*[local-name()=local-name(current())and namespace-uri() = namespace-uri(current())])"/>
      <xsl:text>[</xsl:text>
      <xsl:value-of select="1+ $preceding"/>
      <xsl:text>]</xsl:text>
   </xsl:template>
   <xsl:template match="@*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">@iso:schema</xsl:when>
         <xsl:otherwise>
            <xsl:text>@*[local-name()=''</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>'' and namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: SCHEMATRON-FULL-PATH-2-->
<!--This mode can be used to generate prefixed XPath for humans-->
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
      <xsl:for-each select="ancestor-or-self::*">
         <xsl:text>/</xsl:text>
         <xsl:value-of select="name(.)"/>
         <xsl:if test="preceding-sibling::*[name(.)=name(current())]">
            <xsl:text>[</xsl:text>
            <xsl:value-of/>
            <xsl:text>]</xsl:text>
         </xsl:if>
      </xsl:for-each>
      <xsl:if test="not(self::*)">
         <xsl:text/>/@<xsl:value-of select="name(.)"/>
      </xsl:if>
   </xsl:template>

   <!--MODE: GENERATE-ID-FROM-PATH -->
<xsl:template match="/" mode="generate-id-from-path"/>
   <xsl:template match="text()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.text-'', 1+count(preceding-sibling::text()), ''-'')"/>
   </xsl:template>
   <xsl:template match="comment()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.comment-'', 1+count(preceding-sibling::comment()), ''-'')"/>
   </xsl:template>
   <xsl:template match="processing-instruction()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.processing-instruction-'', 1+count(preceding-sibling::processing-instruction()), ''-'')"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.@'', name())"/>
   </xsl:template>
   <xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:text>.</xsl:text>
      <xsl:choose>
         <xsl:when test="count(. | ../namespace::*) = count(../namespace::*)">
            <xsl:value-of select="concat(''.namespace::-'',1+count(namespace::*),''-'')"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:value-of select="concat(''.'',name(),''-'',1+count(preceding-sibling::*[name()=name(current())]),''-'')"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: GENERATE-ID-2 -->
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
   <xsl:template match="*" mode="generate-id-2" priority="2">
      <xsl:text>U</xsl:text>
      <xsl:number level="multiple" count="*"/>
   </xsl:template>
   <xsl:template match="node()" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>n</xsl:text>
      <xsl:number count="node()"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="string-length(local-name(.))"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="translate(name(),'':'',''.'')"/>
   </xsl:template>
   <!--Strip characters--><xsl:template match="text()" priority="-1"/>

   <!--SCHEMA METADATA-->
<xsl:template match="/">
      <validation-report phase="submit_item">

         <pattern>event_title_required</pattern>
         <xsl:apply-templates select="/" mode="M12"/>
         <pattern>source_title_required</pattern>
         <xsl:apply-templates select="/" mode="M13"/>
         <pattern>creator_role_required</pattern>
         <xsl:apply-templates select="/" mode="M14"/>
         <pattern>correct_date_format</pattern>
         <xsl:apply-templates select="/" mode="M15"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M16"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M17"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M18"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M19"/>
         <pattern>title_required</pattern>
         <xsl:apply-templates select="/" mode="M20"/>
         <pattern>genre_required</pattern>
         <xsl:apply-templates select="/" mode="M21"/>
         <pattern>publisher_name_required</pattern>
         <xsl:apply-templates select="/" mode="M22"/>
         <pattern>organization_name_required</pattern>
         <xsl:apply-templates select="/" mode="M23"/>
         <pattern>creator_required</pattern>
         <xsl:apply-templates select="/" mode="M25"/>
         <pattern>date_modified_required</pattern>
         <xsl:apply-templates select="/" mode="M26"/>
         <pattern>abstract_english_required</pattern>
         <xsl:apply-templates select="/" mode="M27"/>
         <pattern>public_file_required</pattern>
         <xsl:apply-templates select="/" mode="M28"/>
         <pattern>event_required</pattern>
         <xsl:apply-templates select="/" mode="M29"/>
         <pattern>review_method_internal_required</pattern>
         <xsl:apply-templates select="/" mode="M30"/>
      </validation-report>
   </xsl:template>

   <!--SCHEMATRON PATTERNS-->


<!--PATTERN event_title_required-->


	<!--RULE -->
<xsl:template match="event:event" priority="4000" mode="M12">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(* != '''' or @xml:lang != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EventTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M12"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M12"/>
   <xsl:template match="@*|node()" priority="-2" mode="M12">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M12"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M12"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN source_title_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M13">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M13"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M13"/>
   <xsl:template match="@*|node()" priority="-2" mode="M13">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M13"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M13"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_role_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M14">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceCreatorRoleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M14"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M14"/>
   <xsl:template match="@*|node()" priority="-2" mode="M14">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M14"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M14"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN correct_date_format-->


	<!--RULE -->
<xsl:template match="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted"
                 priority="4000"
                 mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:start-date" priority="3999" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:end-date" priority="3998" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or ../escidoc:start-date != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EndDateWithoutStartDate</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M15"/>
   <xsl:template match="@*|node()" priority="-2" mode="M15">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M15"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M15"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M16">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentFileNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M16"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M16"/>
   <xsl:template match="@*|node()" priority="-2" mode="M16">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M16"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M16"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M17">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentContentCategoryNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M17"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M17"/>
   <xsl:template match="@*|node()" priority="-2" mode="M17">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M17"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M17"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M18">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentMimeTypeNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M18"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M18"/>
   <xsl:template match="@*|node()" priority="-2" mode="M18">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M18"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M18"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M19">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentVisibilityNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M19"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M19"/>
   <xsl:template match="@*|node()" priority="-2" mode="M19">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M19"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M19"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN title_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M20">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>TitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M20"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M20"/>
   <xsl:template match="@*|node()" priority="-2" mode="M20">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M20"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M20"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN genre_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M21">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="@type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>GenreNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M21"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M21"/>
   <xsl:template match="@*|node()" priority="-2" mode="M21">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M21"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M21"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN publisher_name_required-->


	<!--RULE -->
<xsl:template match="escidoc:publishing-info" priority="4000" mode="M22">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:publisher != '''' or not(* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>PublisherNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M22"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M22"/>
   <xsl:template match="@*|node()" priority="-2" mode="M22">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M22"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M22"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN organization_name_required-->


	<!--RULE -->
<xsl:template match="organization:organization" priority="4000" mode="M23">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>OrganizationNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M23"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M23"/>
   <xsl:template match="@*|node()" priority="-2" mode="M23">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M23"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M23"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role = ''author''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>AuthorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>MpdlCreatorRequired</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="publication:publication/escidoc:creator/person:person"
                 priority="3999"
                 mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:family-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorFamilyNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M25"/>
   <xsl:template match="@*|node()" priority="-2" mode="M25">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M25"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M25"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN date_modified_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M26">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateModifiedNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M26"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M26"/>
   <xsl:template match="@*|node()" priority="-2" mode="M26">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M26"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M26"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN abstract_english_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M27">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dcterms:abstract[@xml:lang=''en'']"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EnglishAbstractNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M27"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M27"/>
   <xsl:template match="@*|node()" priority="-2" mode="M27">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M27"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M27"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN public_file_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:components" priority="4000" mode="M28">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>NoPublicFileProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M28"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M28"/>
   <xsl:template match="@*|node()" priority="-2" mode="M28">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M28"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M28"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN event_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M29">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EventNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M29"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M29"/>
   <xsl:template match="@*|node()" priority="-2" mode="M29">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M29"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M29"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN review_method_internal_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M30">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="publication:review-method = ''internal''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ReviewMethodInternalNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M30"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M30"/>
   <xsl:template match="@*|node()" priority="-2" mode="M30">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M30"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M30"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
</xsl:stylesheet>');
INSERT INTO escidoc_validation_schema_snippets (id_context_ref, id_content_type_ref, id_validation_point, id_metadata_version_ref, snippet_content) VALUES ('escidoc:150', 'escidoc:persistent4', 'accept_item', '2.0', '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:sch="http://www.ascc.net/xml/schematron"
                xmlns:iso="http://purl.oclc.org/dsdl/schematron"
                xmlns:item="http://www.escidoc.de/schemas/item/0.3"
                xmlns:escidocMetadataRecords="http://www.escidoc.de/schemas/metadatarecords/0.3"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:dcterms="http://purl.org/dc/terms/"
                xmlns:escidocMetadataProfile="http://escidoc.mpg.de/metadataprofile/schema/0.1/"
                 xmlns:escidoc="http://purl.org/escidoc/metadata/terms/0.1/"
				xmlns:escidocComponents="http://www.escidoc.de/schemas/item/0.3/components"
				xmlns:publication="http://purl.org/escidoc/metadata/profiles/0.1/publication"
				xmlns:person="http://purl.org/escidoc/metadata/profiles/0.1/person"
				xmlns:source="http://purl.org/escidoc/metadata/profiles/0.1/source"
				xmlns:event="http://purl.org/escidoc/metadata/profiles/0.1/event"
				xmlns:organization="http://purl.org/escidoc/metadata/profiles/0.1/organization"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is 
    the preferred method for meta-stylesheets to use where possible. The name or details of 
    this mode may change during 1Q 2007.-->


<!--PHASES-->


<!--PROLOG-->


<!--KEYS-->


<!--DEFAULT RULES-->


<!--MODE: SCHEMATRON-FULL-PATH-->
<!--This mode can be used to generate an ugly though full XPath for locators-->
<xsl:template match="*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">
            <xsl:value-of select="name()"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:text>*:</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>[namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:variable name="preceding"
                    select="count(preceding-sibling::*[local-name()=local-name(current())and namespace-uri() = namespace-uri(current())])"/>
      <xsl:text>[</xsl:text>
      <xsl:value-of select="1+ $preceding"/>
      <xsl:text>]</xsl:text>
   </xsl:template>
   <xsl:template match="@*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">@iso:schema</xsl:when>
         <xsl:otherwise>
            <xsl:text>@*[local-name()=''</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>'' and namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: SCHEMATRON-FULL-PATH-2-->
<!--This mode can be used to generate prefixed XPath for humans-->
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
      <xsl:for-each select="ancestor-or-self::*">
         <xsl:text>/</xsl:text>
         <xsl:value-of select="name(.)"/>
         <xsl:if test="preceding-sibling::*[name(.)=name(current())]">
            <xsl:text>[</xsl:text>
            <xsl:value-of/>
            <xsl:text>]</xsl:text>
         </xsl:if>
      </xsl:for-each>
      <xsl:if test="not(self::*)">
         <xsl:text/>/@<xsl:value-of select="name(.)"/>
      </xsl:if>
   </xsl:template>

   <!--MODE: GENERATE-ID-FROM-PATH -->
<xsl:template match="/" mode="generate-id-from-path"/>
   <xsl:template match="text()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.text-'', 1+count(preceding-sibling::text()), ''-'')"/>
   </xsl:template>
   <xsl:template match="comment()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.comment-'', 1+count(preceding-sibling::comment()), ''-'')"/>
   </xsl:template>
   <xsl:template match="processing-instruction()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.processing-instruction-'', 1+count(preceding-sibling::processing-instruction()), ''-'')"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.@'', name())"/>
   </xsl:template>
   <xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:text>.</xsl:text>
      <xsl:choose>
         <xsl:when test="count(. | ../namespace::*) = count(../namespace::*)">
            <xsl:value-of select="concat(''.namespace::-'',1+count(namespace::*),''-'')"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:value-of select="concat(''.'',name(),''-'',1+count(preceding-sibling::*[name()=name(current())]),''-'')"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: GENERATE-ID-2 -->
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
   <xsl:template match="*" mode="generate-id-2" priority="2">
      <xsl:text>U</xsl:text>
      <xsl:number level="multiple" count="*"/>
   </xsl:template>
   <xsl:template match="node()" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>n</xsl:text>
      <xsl:number count="node()"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="string-length(local-name(.))"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="translate(name(),'':'',''.'')"/>
   </xsl:template>
   <!--Strip characters--><xsl:template match="text()" priority="-1"/>

   <!--SCHEMA METADATA-->
<xsl:template match="/">
      <validation-report phase="accept_item">

         <pattern>event_title_required</pattern>
         <xsl:apply-templates select="/" mode="M12"/>
         <pattern>source_title_required</pattern>
         <xsl:apply-templates select="/" mode="M13"/>
         <pattern>creator_role_required</pattern>
         <xsl:apply-templates select="/" mode="M14"/>
         <pattern>correct_date_format</pattern>
         <xsl:apply-templates select="/" mode="M15"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M16"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M17"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M18"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M19"/>
         <pattern>title_required</pattern>
         <xsl:apply-templates select="/" mode="M20"/>
         <pattern>genre_required</pattern>
         <xsl:apply-templates select="/" mode="M21"/>
         <pattern>publisher_name_required</pattern>
         <xsl:apply-templates select="/" mode="M22"/>
         <pattern>organization_name_required</pattern>
         <xsl:apply-templates select="/" mode="M23"/>
         <pattern>creator_required</pattern>
         <xsl:apply-templates select="/" mode="M25"/>
         <pattern>date_modified_required</pattern>
         <xsl:apply-templates select="/" mode="M26"/>
         <pattern>abstract_english_required</pattern>
         <xsl:apply-templates select="/" mode="M27"/>
         <pattern>public_file_required</pattern>
         <xsl:apply-templates select="/" mode="M28"/>
         <pattern>event_required</pattern>
         <xsl:apply-templates select="/" mode="M29"/>
         <pattern>review_method_internal_required</pattern>
         <xsl:apply-templates select="/" mode="M30"/>
      </validation-report>
   </xsl:template>

   <!--SCHEMATRON PATTERNS-->


<!--PATTERN event_title_required-->


	<!--RULE -->
<xsl:template match="event:event" priority="4000" mode="M12">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(* != '''' or @xml:lang != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EventTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M12"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M12"/>
   <xsl:template match="@*|node()" priority="-2" mode="M12">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M12"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M12"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN source_title_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M13">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M13"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M13"/>
   <xsl:template match="@*|node()" priority="-2" mode="M13">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M13"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M13"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_role_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M14">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceCreatorRoleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M14"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M14"/>
   <xsl:template match="@*|node()" priority="-2" mode="M14">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M14"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M14"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN correct_date_format-->


	<!--RULE -->
<xsl:template match="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted"
                 priority="4000"
                 mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:start-date" priority="3999" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:end-date" priority="3998" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or ../escidoc:start-date != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EndDateWithoutStartDate</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M15"/>
   <xsl:template match="@*|node()" priority="-2" mode="M15">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M15"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M15"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M16">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentFileNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M16"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M16"/>
   <xsl:template match="@*|node()" priority="-2" mode="M16">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M16"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M16"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M17">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentContentCategoryNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M17"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M17"/>
   <xsl:template match="@*|node()" priority="-2" mode="M17">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M17"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M17"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M18">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentMimeTypeNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M18"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M18"/>
   <xsl:template match="@*|node()" priority="-2" mode="M18">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M18"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M18"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M19">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentVisibilityNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M19"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M19"/>
   <xsl:template match="@*|node()" priority="-2" mode="M19">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M19"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M19"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN title_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M20">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>TitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M20"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M20"/>
   <xsl:template match="@*|node()" priority="-2" mode="M20">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M20"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M20"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN genre_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M21">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="@type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>GenreNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M21"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M21"/>
   <xsl:template match="@*|node()" priority="-2" mode="M21">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M21"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M21"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN publisher_name_required-->


	<!--RULE -->
<xsl:template match="escidoc:publishing-info" priority="4000" mode="M22">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:publisher != '''' or not(* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>PublisherNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M22"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M22"/>
   <xsl:template match="@*|node()" priority="-2" mode="M22">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M22"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M22"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN organization_name_required-->


	<!--RULE -->
<xsl:template match="organization:organization" priority="4000" mode="M23">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>OrganizationNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M23"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M23"/>
   <xsl:template match="@*|node()" priority="-2" mode="M23">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M23"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M23"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role = ''author''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>AuthorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>MpdlCreatorRequired</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="publication:publication/escidoc:creator/person:person"
                 priority="3999"
                 mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:family-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorFamilyNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M25"/>
   <xsl:template match="@*|node()" priority="-2" mode="M25">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M25"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M25"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN date_modified_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M26">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateModifiedNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M26"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M26"/>
   <xsl:template match="@*|node()" priority="-2" mode="M26">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M26"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M26"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN abstract_english_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M27">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dcterms:abstract[@xml:lang=''en'']"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EnglishAbstractNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M27"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M27"/>
   <xsl:template match="@*|node()" priority="-2" mode="M27">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M27"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M27"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN public_file_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:components" priority="4000" mode="M28">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>NoPublicFileProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M28"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M28"/>
   <xsl:template match="@*|node()" priority="-2" mode="M28">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M28"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M28"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN event_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M29">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EventNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M29"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M29"/>
   <xsl:template match="@*|node()" priority="-2" mode="M29">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M29"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M29"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN review_method_internal_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M30">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="publication:review-method = ''internal''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ReviewMethodInternalNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M30"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M30"/>
   <xsl:template match="@*|node()" priority="-2" mode="M30">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M30"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M30"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
</xsl:stylesheet>');
INSERT INTO escidoc_validation_schema_snippets (id_context_ref, id_content_type_ref, id_validation_point, id_metadata_version_ref, snippet_content) VALUES ('escidoc:138', 'escidoc:persistent4', 'default', '2.0', '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:sch="http://www.ascc.net/xml/schematron"
                xmlns:iso="http://purl.oclc.org/dsdl/schematron"
                xmlns:item="http://www.escidoc.de/schemas/item/0.3"
                xmlns:escidocMetadataRecords="http://www.escidoc.de/schemas/metadatarecords/0.3"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:dcterms="http://purl.org/dc/terms/"
                xmlns:escidocMetadataProfile="http://escidoc.mpg.de/metadataprofile/schema/0.1/"
                 xmlns:escidoc="http://purl.org/escidoc/metadata/terms/0.1/"
				xmlns:escidocComponents="http://www.escidoc.de/schemas/item/0.3/components"
				xmlns:publication="http://purl.org/escidoc/metadata/profiles/0.1/publication"
				xmlns:person="http://purl.org/escidoc/metadata/profiles/0.1/person"
				xmlns:source="http://purl.org/escidoc/metadata/profiles/0.1/source"
				xmlns:event="http://purl.org/escidoc/metadata/profiles/0.1/event"
				xmlns:organization="http://purl.org/escidoc/metadata/profiles/0.1/organization"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is 
    the preferred method for meta-stylesheets to use where possible. The name or details of 
    this mode may change during 1Q 2007.-->


<!--PHASES-->


<!--PROLOG-->


<!--KEYS-->


<!--DEFAULT RULES-->


<!--MODE: SCHEMATRON-FULL-PATH-->
<!--This mode can be used to generate an ugly though full XPath for locators-->
<xsl:template match="*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">
            <xsl:value-of select="name()"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:text>*:</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>[namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:variable name="preceding"
                    select="count(preceding-sibling::*[local-name()=local-name(current())and namespace-uri() = namespace-uri(current())])"/>
      <xsl:text>[</xsl:text>
      <xsl:value-of select="1+ $preceding"/>
      <xsl:text>]</xsl:text>
   </xsl:template>
   <xsl:template match="@*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">@iso:schema</xsl:when>
         <xsl:otherwise>
            <xsl:text>@*[local-name()=''</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>'' and namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: SCHEMATRON-FULL-PATH-2-->
<!--This mode can be used to generate prefixed XPath for humans-->
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
      <xsl:for-each select="ancestor-or-self::*">
         <xsl:text>/</xsl:text>
         <xsl:value-of select="name(.)"/>
         <xsl:if test="preceding-sibling::*[name(.)=name(current())]">
            <xsl:text>[</xsl:text>
            <xsl:value-of/>
            <xsl:text>]</xsl:text>
         </xsl:if>
      </xsl:for-each>
      <xsl:if test="not(self::*)">
         <xsl:text/>/@<xsl:value-of select="name(.)"/>
      </xsl:if>
   </xsl:template>

   <!--MODE: GENERATE-ID-FROM-PATH -->
<xsl:template match="/" mode="generate-id-from-path"/>
   <xsl:template match="text()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.text-'', 1+count(preceding-sibling::text()), ''-'')"/>
   </xsl:template>
   <xsl:template match="comment()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.comment-'', 1+count(preceding-sibling::comment()), ''-'')"/>
   </xsl:template>
   <xsl:template match="processing-instruction()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.processing-instruction-'', 1+count(preceding-sibling::processing-instruction()), ''-'')"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.@'', name())"/>
   </xsl:template>
   <xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:text>.</xsl:text>
      <xsl:choose>
         <xsl:when test="count(. | ../namespace::*) = count(../namespace::*)">
            <xsl:value-of select="concat(''.namespace::-'',1+count(namespace::*),''-'')"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:value-of select="concat(''.'',name(),''-'',1+count(preceding-sibling::*[name()=name(current())]),''-'')"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: GENERATE-ID-2 -->
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
   <xsl:template match="*" mode="generate-id-2" priority="2">
      <xsl:text>U</xsl:text>
      <xsl:number level="multiple" count="*"/>
   </xsl:template>
   <xsl:template match="node()" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>n</xsl:text>
      <xsl:number count="node()"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="string-length(local-name(.))"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="translate(name(),'':'',''.'')"/>
   </xsl:template>
   <!--Strip characters--><xsl:template match="text()" priority="-1"/>

   <!--SCHEMA METADATA-->
<xsl:template match="/">
      <validation-report phase="default">

         <pattern>event_title_required</pattern>
         <xsl:apply-templates select="/" mode="M12"/>
         <pattern>source_title_required</pattern>
         <xsl:apply-templates select="/" mode="M13"/>
         <pattern>creator_role_required</pattern>
         <xsl:apply-templates select="/" mode="M14"/>
         <pattern>correct_date_format</pattern>
         <xsl:apply-templates select="/" mode="M15"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M16"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M17"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M18"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M19"/>
         <pattern>title_required</pattern>
         <xsl:apply-templates select="/" mode="M20"/>
         <pattern>genre_required</pattern>
         <xsl:apply-templates select="/" mode="M21"/>
         <pattern>publisher_name_required</pattern>
         <xsl:apply-templates select="/" mode="M22"/>
         <pattern>organization_name_required</pattern>
         <xsl:apply-templates select="/" mode="M23"/>
         <pattern>creator_required</pattern>
         <xsl:apply-templates select="/" mode="M25"/>
      </validation-report>
   </xsl:template>

   <!--SCHEMATRON PATTERNS-->


<!--PATTERN event_title_required-->


	<!--RULE -->
<xsl:template match="event:event" priority="4000" mode="M12">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(* != '''' or @xml:lang != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EventTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M12"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M12"/>
   <xsl:template match="@*|node()" priority="-2" mode="M12">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M12"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M12"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN source_title_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M13">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M13"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M13"/>
   <xsl:template match="@*|node()" priority="-2" mode="M13">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M13"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M13"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_role_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M14">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceCreatorRoleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M14"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M14"/>
   <xsl:template match="@*|node()" priority="-2" mode="M14">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M14"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M14"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN correct_date_format-->


	<!--RULE -->
<xsl:template match="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted"
                 priority="4000"
                 mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:start-date" priority="3999" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:end-date" priority="3998" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or ../escidoc:start-date != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EndDateWithoutStartDate</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M15"/>
   <xsl:template match="@*|node()" priority="-2" mode="M15">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M15"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M15"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M16">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentFileNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M16"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M16"/>
   <xsl:template match="@*|node()" priority="-2" mode="M16">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M16"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M16"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M17">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentContentCategoryNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M17"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M17"/>
   <xsl:template match="@*|node()" priority="-2" mode="M17">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M17"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M17"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M18">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentMimeTypeNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M18"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M18"/>
   <xsl:template match="@*|node()" priority="-2" mode="M18">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M18"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M18"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M19">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentVisibilityNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M19"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M19"/>
   <xsl:template match="@*|node()" priority="-2" mode="M19">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M19"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M19"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN title_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M20">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>TitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M20"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M20"/>
   <xsl:template match="@*|node()" priority="-2" mode="M20">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M20"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M20"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN genre_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M21">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="@type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>GenreNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M21"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M21"/>
   <xsl:template match="@*|node()" priority="-2" mode="M21">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M21"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M21"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN publisher_name_required-->


	<!--RULE -->
<xsl:template match="escidoc:publishing-info" priority="4000" mode="M22">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:publisher != '''' or not(* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>PublisherNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M22"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M22"/>
   <xsl:template match="@*|node()" priority="-2" mode="M22">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M22"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M22"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN organization_name_required-->


	<!--RULE -->
<xsl:template match="organization:organization" priority="4000" mode="M23">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>OrganizationNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M23"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M23"/>
   <xsl:template match="@*|node()" priority="-2" mode="M23">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M23"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M23"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role = ''author''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>AuthorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>MpdlCreatorRequired</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="publication:publication/escidoc:creator/person:person"
                 priority="3999"
                 mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:family-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorFamilyNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M25"/>
   <xsl:template match="@*|node()" priority="-2" mode="M25">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M25"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M25"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
</xsl:stylesheet>');
INSERT INTO escidoc_validation_schema_snippets (id_context_ref, id_content_type_ref, id_validation_point, id_metadata_version_ref, snippet_content) VALUES ('escidoc:138', 'escidoc:persistent4', 'submit_item', '2.0', '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:sch="http://www.ascc.net/xml/schematron"
                xmlns:iso="http://purl.oclc.org/dsdl/schematron"
                xmlns:item="http://www.escidoc.de/schemas/item/0.3"
                xmlns:escidocMetadataRecords="http://www.escidoc.de/schemas/metadatarecords/0.3"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:dcterms="http://purl.org/dc/terms/"
                xmlns:escidocMetadataProfile="http://escidoc.mpg.de/metadataprofile/schema/0.1/"
                 xmlns:escidoc="http://purl.org/escidoc/metadata/terms/0.1/"
				xmlns:escidocComponents="http://www.escidoc.de/schemas/item/0.3/components"
				xmlns:publication="http://purl.org/escidoc/metadata/profiles/0.1/publication"
				xmlns:person="http://purl.org/escidoc/metadata/profiles/0.1/person"
				xmlns:source="http://purl.org/escidoc/metadata/profiles/0.1/source"
				xmlns:event="http://purl.org/escidoc/metadata/profiles/0.1/event"
				xmlns:organization="http://purl.org/escidoc/metadata/profiles/0.1/organization"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is 
    the preferred method for meta-stylesheets to use where possible. The name or details of 
    this mode may change during 1Q 2007.-->


<!--PHASES-->


<!--PROLOG-->


<!--KEYS-->


<!--DEFAULT RULES-->


<!--MODE: SCHEMATRON-FULL-PATH-->
<!--This mode can be used to generate an ugly though full XPath for locators-->
<xsl:template match="*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">
            <xsl:value-of select="name()"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:text>*:</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>[namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:variable name="preceding"
                    select="count(preceding-sibling::*[local-name()=local-name(current())and namespace-uri() = namespace-uri(current())])"/>
      <xsl:text>[</xsl:text>
      <xsl:value-of select="1+ $preceding"/>
      <xsl:text>]</xsl:text>
   </xsl:template>
   <xsl:template match="@*" mode="schematron-get-full-path">
      <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
      <xsl:text>/</xsl:text>
      <xsl:choose>
         <xsl:when test="namespace-uri()=''''">@iso:schema</xsl:when>
         <xsl:otherwise>
            <xsl:text>@*[local-name()=''</xsl:text>
            <xsl:value-of select="local-name()"/>
            <xsl:text>'' and namespace-uri()=''</xsl:text>
            <xsl:value-of select="namespace-uri()"/>
            <xsl:text>'']</xsl:text>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: SCHEMATRON-FULL-PATH-2-->
<!--This mode can be used to generate prefixed XPath for humans-->
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
      <xsl:for-each select="ancestor-or-self::*">
         <xsl:text>/</xsl:text>
         <xsl:value-of select="name(.)"/>
         <xsl:if test="preceding-sibling::*[name(.)=name(current())]">
            <xsl:text>[</xsl:text>
            <xsl:value-of/>
            <xsl:text>]</xsl:text>
         </xsl:if>
      </xsl:for-each>
      <xsl:if test="not(self::*)">
         <xsl:text/>/@<xsl:value-of select="name(.)"/>
      </xsl:if>
   </xsl:template>

   <!--MODE: GENERATE-ID-FROM-PATH -->
<xsl:template match="/" mode="generate-id-from-path"/>
   <xsl:template match="text()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.text-'', 1+count(preceding-sibling::text()), ''-'')"/>
   </xsl:template>
   <xsl:template match="comment()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.comment-'', 1+count(preceding-sibling::comment()), ''-'')"/>
   </xsl:template>
   <xsl:template match="processing-instruction()" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.processing-instruction-'', 1+count(preceding-sibling::processing-instruction()), ''-'')"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-from-path">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:value-of select="concat(''.@'', name())"/>
   </xsl:template>
   <xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
      <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
      <xsl:text>.</xsl:text>
      <xsl:choose>
         <xsl:when test="count(. | ../namespace::*) = count(../namespace::*)">
            <xsl:value-of select="concat(''.namespace::-'',1+count(namespace::*),''-'')"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:value-of select="concat(''.'',name(),''-'',1+count(preceding-sibling::*[name()=name(current())]),''-'')"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--MODE: GENERATE-ID-2 -->
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
   <xsl:template match="*" mode="generate-id-2" priority="2">
      <xsl:text>U</xsl:text>
      <xsl:number level="multiple" count="*"/>
   </xsl:template>
   <xsl:template match="node()" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>n</xsl:text>
      <xsl:number count="node()"/>
   </xsl:template>
   <xsl:template match="@*" mode="generate-id-2">
      <xsl:text>U.</xsl:text>
      <xsl:number level="multiple" count="*"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="string-length(local-name(.))"/>
      <xsl:text>_</xsl:text>
      <xsl:value-of select="translate(name(),'':'',''.'')"/>
   </xsl:template>
   <!--Strip characters--><xsl:template match="text()" priority="-1"/>

   <!--SCHEMA METADATA-->
<xsl:template match="/">
      <validation-report phase="submit_item">

         <pattern>event_title_required</pattern>
         <xsl:apply-templates select="/" mode="M12"/>
         <pattern>source_title_required</pattern>
         <xsl:apply-templates select="/" mode="M13"/>
         <pattern>creator_role_required</pattern>
         <xsl:apply-templates select="/" mode="M14"/>
         <pattern>correct_date_format</pattern>
         <xsl:apply-templates select="/" mode="M15"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M16"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M17"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M18"/>
         <pattern>component_data_required</pattern>
         <xsl:apply-templates select="/" mode="M19"/>
         <pattern>title_required</pattern>
         <xsl:apply-templates select="/" mode="M20"/>
         <pattern>genre_required</pattern>
         <xsl:apply-templates select="/" mode="M21"/>
         <pattern>publisher_name_required</pattern>
         <xsl:apply-templates select="/" mode="M22"/>
         <pattern>organization_name_required</pattern>
         <xsl:apply-templates select="/" mode="M23"/>
         <pattern>creator_required</pattern>
         <xsl:apply-templates select="/" mode="M25"/>
         <pattern>date_modified_required</pattern>
         <xsl:apply-templates select="/" mode="M26"/>
         <pattern>abstract_english_required</pattern>
         <xsl:apply-templates select="/" mode="M27"/>
         <pattern>public_file_required</pattern>
         <xsl:apply-templates select="/" mode="M28"/>
         <pattern>event_required</pattern>
         <xsl:apply-templates select="/" mode="M29"/>
         <pattern>review_method_internal_required</pattern>
         <xsl:apply-templates select="/" mode="M30"/>
      </validation-report>
   </xsl:template>

   <!--SCHEMATRON PATTERNS-->


<!--PATTERN event_title_required-->


	<!--RULE -->
<xsl:template match="event:event" priority="4000" mode="M12">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(* != '''' or @xml:lang != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EventTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M12"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M12"/>
   <xsl:template match="@*|node()" priority="-2" mode="M12">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M12"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M12"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN source_title_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M13">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(normalize-space(.) != '''' or .//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceTitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M13"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M13"/>
   <xsl:template match="@*|node()" priority="-2" mode="M13">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M13"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M13"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_role_required-->


	<!--RULE -->
<xsl:template match="source:source" priority="4000" mode="M14">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role != '''' or not(normalize-space(escidoc:creator) != '''' or escidoc:creator//*/@* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>SourceCreatorRoleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M14"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M14"/>
   <xsl:template match="@*|node()" priority="-2" mode="M14">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M14"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M14"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN correct_date_format-->


	<!--RULE -->
<xsl:template match="dcterms:created|dcterms:modified|dcterms:issued|dcterms:dateAccepted|dcterms:dateSubmitted"
                 priority="4000"
                 mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:start-date" priority="3999" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="escidoc:end-date" priority="3998" mode="M15">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or (matches(., ''^\\d\\d\\d\\d(-\\d\\d){0,2}$'') and substring(concat(., ''-01-01''), 1, 10) castable as xs:date)"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateFormatIncorrect</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test=". = '''' or ../escidoc:start-date != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EndDateWithoutStartDate</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M15"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M15"/>
   <xsl:template match="@*|node()" priority="-2" mode="M15">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M15"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M15"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M16">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:file-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentFileNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M16"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M16"/>
   <xsl:template match="@*|node()" priority="-2" mode="M16">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M16"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M16"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M17">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:content-category != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentContentCategoryNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M17"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M17"/>
   <xsl:template match="@*|node()" priority="-2" mode="M17">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M17"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M17"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M18">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:mime-type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentMimeTypeNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M18"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M18"/>
   <xsl:template match="@*|node()" priority="-2" mode="M18">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M18"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M18"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN component_data_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:component" priority="4000" mode="M19">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(escidocComponents:content/@xlink:href != '''') or escidocComponents:properties/escidocComponents:visibility != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ComponentVisibilityNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M19"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M19"/>
   <xsl:template match="@*|node()" priority="-2" mode="M19">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M19"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M19"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN title_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M20">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>TitleNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M20"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M20"/>
   <xsl:template match="@*|node()" priority="-2" mode="M20">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M20"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M20"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN genre_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M21">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="@type != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>GenreNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M21"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M21"/>
   <xsl:template match="@*|node()" priority="-2" mode="M21">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M21"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M21"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN publisher_name_required-->


	<!--RULE -->
<xsl:template match="escidoc:publishing-info" priority="4000" mode="M22">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:publisher != '''' or not(* != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>PublisherNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M22"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M22"/>
   <xsl:template match="@*|node()" priority="-2" mode="M22">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M22"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M22"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN organization_name_required-->


	<!--RULE -->
<xsl:template match="organization:organization" priority="4000" mode="M23">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dc:title != '''' or not(escidoc:address) or escidoc:address = ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>OrganizationNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M23"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M23"/>
   <xsl:template match="@*|node()" priority="-2" mode="M23">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M23"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M23"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN creator_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/person:person/escidoc:family-name != '''' or escidoc:creator/organization:organization/dc:title"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator/@role = ''author''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>AuthorNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>

		    <!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:creator//dc:title[contains(., ''Max Planck Digital Library'')]"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>MpdlCreatorRequired</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>

	  <!--RULE -->
<xsl:template match="publication:publication/escidoc:creator/person:person"
                 priority="3999"
                 mode="M25">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidoc:family-name != ''''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>CreatorFamilyNameNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M25"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M25"/>
   <xsl:template match="@*|node()" priority="-2" mode="M25">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M25"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M25"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN date_modified_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M26">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dcterms:modified != '''' and substring(concat(dcterms:modified, ''-01-01''), 1, 10) castable as xs:date and xs:date(substring(concat(dcterms:modified, ''-01-01''), 1, 10)) &gt; xs:date(''2007-01-01'')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>DateModifiedNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M26"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M26"/>
   <xsl:template match="@*|node()" priority="-2" mode="M26">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M26"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M26"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN abstract_english_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M27">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="dcterms:abstract[@xml:lang=''en'']"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EnglishAbstractNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M27"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M27"/>
   <xsl:template match="@*|node()" priority="-2" mode="M27">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M27"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M27"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN public_file_required-->


	<!--RULE -->
<xsl:template match="escidocComponents:components" priority="4000" mode="M28">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="escidocComponents:component/escidocComponents:properties/escidocComponents:visibility = ''public''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>NoPublicFileProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M28"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M28"/>
   <xsl:template match="@*|node()" priority="-2" mode="M28">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M28"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M28"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN event_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M29">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="not(@type = ''proceedings'' or @type = ''talk-at-event'' or @type = ''conference-paper'' or @type = ''conference-report'' or @type = ''courseware-lecture'') or (event:event/dc:title != '''')"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>EventNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M29"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M29"/>
   <xsl:template match="@*|node()" priority="-2" mode="M29">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M29"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M29"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

   <!--PATTERN review_method_internal_required-->


	<!--RULE -->
<xsl:template match="publication:publication" priority="4000" mode="M30">

		<!--ASSERT -->
<xsl:choose>
         <xsl:when test="publication:review-method = ''internal''"/>
         <xsl:otherwise>
            <failure infolevel="restrictive">
               <message>
                  <name>ReviewMethodInternalNotProvided</name>
                  <path>
                     <xsl:apply-templates mode="schematron-get-full-path" select="."/>
                  </path>
                  <element>
                     <xsl:value-of select="name()"/>
                  </element>
               </message>
               <diagnostics/>
            </failure>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:apply-templates select="@*|*|comment()|processing-instruction()" mode="M30"/>
   </xsl:template>
   <xsl:template match="text()" priority="-1" mode="M30"/>
   <xsl:template match="@*|node()" priority="-2" mode="M30">
      <xsl:choose><!--Housekeeping: SAXON warns if attempting to find the attribute
                           of an attribute--><xsl:when test="not(@*)">
            <xsl:apply-templates select="node()" mode="M30"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates select="@*|node()" mode="M30"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
</xsl:stylesheet>');
