org.eclipse.cosmos/tests/resource-modeling/org.eclipse.cosmos.rm.validation.tests/src/test-resources/others/InValidMultipleDocument.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (download) (as text) (annotate)
Mon Aug 18 17:18:49 2008 UTC (17 months, 3 weeks ago) by amehregani
Branch: MAIN
CVS Tags: COSMOS_1_0_0, v1_0_0_i13
Branch point for: COSMOS-1_0_0
Changes since 1.6: +10 -9 lines
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237921
<?xml version="1.0" encoding="utf-8"?>
<!-- 
/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
 
 -->
<model xmlns="http://www.w3.org/2008/09/sml-if" schemaComplete="true">
  <identity>
    <name>InvalidMultipleDocument</name>
    <baseURI>
		http://interop.serviceml.org
	</baseURI>
    <description>
    This test verifies that the code returns an error if the data element contains more than one document.
    </description>
    

  </identity>
  <definitions>
    <document>
      <data> 
      <xs:schema targetNamespace="urn:university"
                elementFormDefault="qualified"
                xmlns:tns="urn:university"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:sml="http://www.w3.org/2008/09/sml">

        <xs:element name="EnrolledCourse"/>
        <xs:element name="Student" type="tns:StudentType"/>
        <xs:element name="Course" type="tns:CourseType"/>
        <xs:element name="Courses">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Course" type="tns:CourseType" 
                          minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>

        <xs:complexType name="CourseType">
          <xs:sequence>
            <xs:element name="Name" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>

        <xs:complexType name="StudentType">
          <xs:sequence>
            <xs:element name="ID" type="xs:string"/>
            <xs:element name="EnrolledCourses" minOccurs="0">
              <xs:complexType>
                <xs:sequence>
                  <xs:element ref="tns:EnrolledCourse" 
                              maxOccurs="unbounded"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
        
	<xs:element name="customReferenceScheme" type="xs:anyURI"/>
        
      </xs:schema>
      </data>
    </document>
  </definitions>
  <instances>
    <document>
      <data> 
        <Student xmlns="urn:university"
                 xmlns:sml="http://www.w3.org/2008/09/sml">
          <ID>1001</ID>
        </Student>
        <!-- Should cause an error because two instances of a document appear under one data -->
        <!-- element -->
        <Student xmlns="urn:university"
                 xmlns:sml="http://www.w3.org/2008/09/sml">
          <ID>1002</ID>
        </Student>        
      </data>
    </document>
  </instances>
</model>