org.eclipse.cosmos/tests/resource-modeling/org.eclipse.cosmos.rm.validation.tests/src/test-resources/deref/MultipleNonRoot.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (download) (as text) (annotate)
Mon May 25 15:11:15 2009 UTC (5 months, 4 weeks ago) by dwhiteman
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +5 -5 lines
276993: [sml val] Implementation does not support final standard
https://bugs.eclipse.org/bugs/show_bug.cgi?id=276993
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2006 by BEA, BMC, CA, Cisco, Dell, EMC, HP, IBM, Intel, Microsoft, and Sun.  All rights reserved. -->
<!-- Permission to copy, display, and distribute this Service Modeling Language Interop Workshop (SML-IF) XML Document, testing dereferencing references that resolve to non-root elements, in any medium without fee or royalty is hereby granted, provided that you include the following on ALL copies of the SML-IF XML Document, or portions thereof, that you make:
 
1. A link or URL to the SML-IF XML Document at this location: 
http://schemas.serviceml.org/smlif/deref/2006/10/MultipleNonRoot.xml

2. The copyright notice as shown in the SML-IF XML Document.

BEA, BMC, CA, Cisco, Dell, EMC, HP, IBM, Intel, Microsoft, and Sun (collectively, the “Authors᾿) each agree to grant you a royalty-free license, under reasonable, non-discriminatory terms and conditions to their respective patents that they deem necessary to implement the Service Modeling Language Interop Workshop XML Document testing dereferencing references that resolve to non-root elements.

THE SML-IF XML DOCUMENT IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE SML-IF XML DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE SML-IF XML DOCUMENT.

The name and trademarks of the Authors may NOT be used in any manner, including advertising or publicity pertaining to the SML-IF XML Document or its contents without specific, written prior permission. Title to copyright in the SML-IF XML Document will at all times remain with the Authors. -->
<model xmlns="http://www.w3.org/ns/sml-if" schemaComplete="true">
  <identity>
    <name>MultipleXpointer</name>
    <baseURI>
		http://interop.serviceml.org
	</baseURI>
    <description>
      Verify that deref() can resolve references that target non-root
      elements using XPointer scheme.
    </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/ns/sml"
        xmlns:smlfn=
              "http://www.w3.org/ns/sml-function">

        <xs:element name="EnrolledStudent"/>
        <xs:element name="Students" 
                    type="tns:StudentsType"/>
        <xs:element name="University" 
                    type="tns:UniversityType">
          <xs:annotation>
            <xs:appinfo>
              <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                <sch:ns prefix="smlfn" uri="http://www.w3.org/ns/sml-function"/>
                <sch:ns prefix="tns" uri="urn:university"/>
                <sch:pattern id="countTest">
                  <sch:rule context=".">
                    <sch:assert test="count(smlfn:deref(tns:EnrolledStudents/tns:EnrolledStudent))=3"/>
                  </sch:rule>
                </sch:pattern>
              </sch:schema>
            </xs:appinfo>
          </xs:annotation>
        </xs:element>
        <xs:complexType name="StudentType">
          <xs:sequence>
            <xs:element name="ID" type="xs:string"/>
            <xs:element name="Name" type="xs:string"/>
          </xs:sequence>
          <xs:attribute name="SSN" type="xs:string" 
                        use="optional"/>
        </xs:complexType>

        <xs:complexType name="StudentsType">
          <xs:sequence>
            <xs:element name="Student" type="tns:StudentType" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>

        <xs:complexType name="UniversityType">
          <xs:sequence>
            <xs:element name="Name" type="xs:string"/>
            <xs:element name="EnrolledStudents" minOccurs="0">
              <xs:complexType>
                <xs:sequence>
                  <xs:element ref="tns:EnrolledStudent" 
                              maxOccurs="unbounded"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:schema>
      </data>
    </document>
  </definitions>
  <instances>
    <document>
      <docinfo>
        <aliases>
          <alias>http://interop.serviceml.org/Students.xml</alias>
        </aliases>
      </docinfo>
      <data>
        <Students xmlns="urn:university">

          <Student SSN="123-22-4444">
            <ID>1000</ID>
            <Name>John</Name>
          </Student>
          <Student xmlns="urn:university" 
                   SSN="333-22-4444">
            <ID>1001</ID>
            <Name>John</Name>
          </Student>
          <Student xmlns="urn:university">
            <ID>1002</ID>
            <Name>John</Name>
          </Student>
        </Students>
      </data>
    </document>
    <document>
      <data>
        <University xmlns="urn:university"
         xmlns:sml="http://www.w3.org/ns/sml">
          <Name>MIT</Name>
          <EnrolledStudents>
            <EnrolledStudent sml:ref="true" xmlns:u="urn:university">
              <sml:uri>
                Students.xml#xpointer(/Students/Student[ID="1000"])
              </sml:uri>
            </EnrolledStudent>
            <EnrolledStudent sml:ref="true">
              <sml:uri>
                Students.xml#xpointer(/Students/Student[ID="1001"])
              </sml:uri>
            </EnrolledStudent>
            <EnrolledStudent sml:ref="true">
              <sml:uri>
                Students.xml#xmlns(u=urn:university)
                xpointer(/u:Students/u:Student[u:ID="1002"])
              </sml:uri>
            </EnrolledStudent>
          </EnrolledStudents>
        </University>
      </data>
    </document>
  </instances>
</model>