<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns="http://purl.oclc.org/dsdl/schematron"
	xmlns:sch="http://purl.oclc.org/dsdl/schematron"
	xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
	xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
	xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
	xmlns:ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-2"
	xmlns:doc="urn:oasis:names:specification:ubl:schema:xsd:RequestForQuotationCancellation-2"
	queryBinding="xslt2"
	schemaVersion="ISO19757-3"
>
<sch:ns prefix="cbc" uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<sch:ns prefix="cac" uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" />
<sch:ns prefix="qdt" uri="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2" />
<sch:ns prefix="ccts" uri="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-2" />
<sch:ns prefix="doc" uri="urn:oasis:names:specification:ubl:schema:xsd:RequestForQuotationCancellation-2" />
	<sch:pattern id="RequestForQuotationCancellation">
		<sch:rule context="/doc:RequestForQuotationCancellation/cbc:UBLVersionID">
			<sch:assert test="normalize-space(text()) = '2.0'">Het bericht MOET gebaseerd zijn op UBL Versie 2.0</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cbc:CustomizationID">
			<sch:assert test="normalize-space(text()) = '1.4'">Bericht MOET gebaseerd zijn op versie 1.4 van de Nederlandse specificatie.</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cbc:ProfileID">
			<sch:assert test="normalize-space(text()) = 'NL'">Bericht MOET gebaseerd zijn op de Nederlande (NL) specificatie</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:DocumentReference">
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation">
			<sch:assert test="exists(cbc:UBLVersionID) ">/doc:RequestForQuotationCancellation/cbc:UBLVersionID element should exist!</sch:assert>
			<sch:assert test="exists(cbc:CustomizationID) ">/doc:RequestForQuotationCancellation/cbc:CustomizationID element should exist!</sch:assert>
			<sch:assert test="exists(cbc:ProfileID) ">/doc:RequestForQuotationCancellation/cbc:ProfileID element should exist!</sch:assert>
			<sch:assert test="not(empty(cbc:ID))">/doc:RequestForQuotationCancellation/cbc:ID element should not be empty!</sch:assert>
			<sch:assert test="every $bn in //cbc:BuildingNumber satisfies (matches($bn,'^\d+(-[ \w]+)?$'))">Huisnummer en Huisnummertoevoeging moeten achter elkaar geplaatst worden, gescheiden met een koppelteken.</sch:assert>
			<sch:assert test="every $id in //cac:PartyIdentification/cbc:ID satisfies (exists($id/@schemeAgencyID) and not(empty($id/@schemeAgencyID)) and exists($id/@schemeAgencyName) and not(empty($id/@schemeAgencyName)))">PartyIdentification/ID MOET @schemeAgencyID en @schemeAgencyName attributen bevatten.</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_OriginatorCustomerParty">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty">
			<sch:assert test="exists(cac:Party) ">/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party element should exist!</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_OriginatorCustomerParty_Party">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party">
			<sch:assert test="exists(cac:PartyName) ">/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:PartyName element should exist!</sch:assert>
			<sch:assert test="count(cac:PartyName) lt 2 ">/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:PartyName element should be less than 2!</sch:assert>
			<sch:assert test="exists(cac:Contact) ">/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:Contact element should exist!</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:PartyIdentification">
			<sch:assert test="not(empty(cbc:ID))">/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID element should not be empty!</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:PartyName">
			<sch:assert test="not(empty(cbc:Name))">/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:PartyName/cbc:Name element should not be empty!</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_OriginatorCustomerParty_Party_Contact">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:Contact/cbc:Name">
			<sch:assert test="string-length(text()) > 0 ">/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:Contact/cbc:Name element should exist!</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:Contact">
			<sch:assert test="exists(cbc:Name) ">/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:Contact/cbc:Name element should exist!</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_SellerSupplierParty">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:SellerSupplierParty">
			<sch:assert test="exists(cac:Party) ">/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party element should exist!</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cbc:CustomerAssignedAccountID">
			<sch:assert test="string-length(text()) > 0 ">/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cbc:CustomerAssignedAccountID element should exist!</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_SellerSupplierParty_Party">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party">
			<sch:assert test="count(cac:PartyName) lt 2 ">/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PartyName element should be less than 2!</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PartyName">
			<sch:assert test="not(empty(cbc:Name))">/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PartyName/cbc:Name element should not be empty!</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_SellerSupplierParty_Party_PostalAddress">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PostalAddress">
			<sch:assert test="exists(cac:Country) ">/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PostalAddress/cac:Country element should exist!</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_OriginatorCustomerParty_Party_PartyIdentification">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:OriginatorCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID">
			<sch:assert test="exists(@schemeAgencyName)">Identificatienummer bron MOET aangegeven worden, veelal 'Kamer van Koophandel' of 'Belastingdienst' voor NL bedrijven.</sch:assert>
			<sch:assert test="string-length(@schemeAgencyName) > 0">Identificatienummer bron MOET aangegeven worden, veelal 'Kamer van Koophandel' of 'Belastingdienst' voor NL bedrijven.</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_SellerSupplierParty_Party_PartyIdentification">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID">
			<sch:assert test="exists(@schemeAgencyName)">De uitgever van het identificatienummer MOET opgegeven worden, veelal 'Kamer van Koophandel' of 'Belastingdienst' voor NL bedrijven.</sch:assert>
			<sch:assert test="string-length(text()) > 0 ">/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID element should exist!</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PartyIdentification">
			<sch:assert test="exists(cbc:ID) ">/doc:RequestForQuotationCancellation/cac:SellerSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID element should exist!</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_DocumentReference">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:DocumentReference/cbc:DocumentType">
			<sch:assert test="string-length(text()) > 0 ">/doc:RequestForQuotationCancellation/cac:DocumentReference/cbc:DocumentType element should exist!</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:DocumentReference">
			<sch:assert test="exists(cbc:DocumentType) and not(empty(cbc:DocumentType))">Indien de identificatie van een offerte meegegeven wordt, moet hier 'Offerte' opgegeven worden.</sch:assert>
		</sch:rule>
	</sch:pattern>
	<sch:pattern id="RequestForQuotationCancellation_DocumentReference_Attachment">
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:DocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject">
			<sch:assert test="string-length(text()) > 0 ">/doc:RequestForQuotationCancellation/cac:DocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject element should exist!</sch:assert>
			<sch:assert test="string-length(@mimeCode) > 0 ">/doc:RequestForQuotationCancellation/cac:DocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@mimeCode element should exist!</sch:assert>
			<sch:assert test="exists(@mimeCode)">/doc:RequestForQuotationCancellation/cac:DocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@mimeCode element should exist!</sch:assert>
		</sch:rule>
		<sch:rule context="/doc:RequestForQuotationCancellation/cac:DocumentReference/cac:Attachment">
			<sch:assert test="exists(cbc:EmbeddedDocumentBinaryObject) ">/doc:RequestForQuotationCancellation/cac:DocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject element should exist!</sch:assert>
		</sch:rule>
	</sch:pattern>
</sch:schema>