<?xml version="1.0" encoding="UTF-8"?>
<!-- 
(c) 2003 Electronic Data Systems Corporation. All Rights Reserved. 
This software and related documentation are proprietary to EDS. 
LIMITATIONS TO U.S. GOVERNMENT RIGHTS.  UNPUBLISHED - RIGHTS 
RESERVED UNDER THE COPYRIGHT LAWS OF THE UNITED STATES. This 
computer software and related computer software documentation have 
been developed exclusively at private expense and are provided 
subject to the following rights:  If this computer software and 
computer software documentation qualify as "commercial items" (as 
that term is defined in FAR 2.101), their use, duplication or 
disclosure by the U.S. Government is subject to the protections 
and restrictions as set forth in the EDS commercial license for 
the software and/or documentation, as prescribed in FAR 12.212 
and FAR 27.405(b)(2)(i) (for civilian agencies) and in 
DFARS 227.7202-1(a) and DFARS 227.7202-3(a) (for the Department 
of Defense), or any successor or similar regulation, as applicable
or as amended from time to time. If this computer software and 
computer documentation do not qualify as "commercial items," then 
they are "restricted computer software" and are provided with 
"restrictive rights," and their use, duplication or disclosure by 
the U.S. Government is subject to the protections and restrictions 
as set forth in FAR 27.404(b) and FAR 52-227-14 (for civilian 
agencies), and DFARS 227.7203-5(c) and DFARS 252.227-7014 (for the 
Department of Defense), or any successor or similar regulation, as 
applicable or as amended from time to time. 

Electronic Data Systems Corporation, 5400 Legacy Drive, 
Plano, Texas 75024.
-->
<xsd:schema targetNamespace="http://www.plmxml.org/Schemas/PLMXMLSchema" xmlns:plm="http://www.plmxml.org/Schemas/PLMXMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" xml:lang="en">
  <xsd:include schemaLocation="PLMXMLSchema.xsd"/>
  <xsd:annotation>
    <xsd:documentation>
    
                        PLMXML Delta Schema
                        
    </xsd:documentation>
    <xsd:appinfo source="http://www.plmxml.org/Schemas/PLMXMLDeltaSchema">
      <plm:SchemaInfo name="PLMXMLDeltaSchema.xsd" date="2003-10-21" version="5.0" status="release"/>
    </xsd:appinfo>
  </xsd:annotation>
  <!-- -->
  <xsd:complexType name="DeltaAddType">
    <xsd:annotation>
      <xsd:documentation>
      This element represents adding a fragment of PLMXML, i.e. a tree of elements, to
      a master document.
      
      The sub-elements of this element are all added.
      
      Attributes:
      
      parentRef:       A URI reference to a placeholder element which represents the
                       element in the master document which will become the parent of the
                       added elements. Exactly one of parentRef or siblingRef should be present.
                       
      siblingRef:      A URI reference to a placeholder element which represents the
                       element in the master document which will become a sibling
                       of the added elements. There is no implication that the added element
                       will be adjacent to the sibling element in the sub-element ordering -
                       only that it will have the same parent.
      
      Elements:
      
      Any PLMXML elements may be included as sub-elements.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element ref="plm:AttribOwner"/>
    </xsd:choice>
    <xsd:attribute name="parentRef" type="plm:anyURIType" use="optional"/>
    <xsd:attribute name="siblingRef" type="plm:anyURIType" use="optional"/>
  </xsd:complexType>
  <!-- -->
  <xsd:complexType name="DeltaReplaceType">
    <xsd:annotation>
      <xsd:documentation>
      This element represents replacing a fragment of PLMXML, i.e. a tree of elements, with
      another tree.
      
      The sub-element of this element is used to replace the target element and all its
      descendents.
      
      Attributes:
      
      targetRef:       A URI reference to a placeholder element which represents the
                       element in the master document which will be replaced.
      
      Elements:
      
      Any PLMXML element may be included as sub-element. There must be exactly one.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element ref="plm:AttribOwner"/>
    </xsd:sequence>
    <xsd:attribute name="targetRef" type="plm:anyURIType" use="required"/>
  </xsd:complexType>
  <!-- -->
  <xsd:complexType name="DeltaDeleteType">
    <xsd:annotation>
      <xsd:documentation>
      This element represents deleting a fragment of PLMXML, i.e. a tree of elements, from
      a master document.
      
      NOTE that it also removes any IDREF or local URI references to those elements, since 
      normally you would not want 'dangling' references left. For example, deleting an Instance 
      will automatically remove that Instance from any 'instanceRefs' attributes which reference
      it. 
      
      Attributes:
      
      targetRefs:       A multiple URI reference to placeholder element(s) which represent the
                        elements in the master document which will be deleted, along with
                        their sub-elements.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="targetRefs" type="plm:uriReferenceListType" use="required"/>
  </xsd:complexType>
  <!-- -->
  <xsd:simpleType name="DeltaModifyOpType">
    <xsd:restriction base="xsd:NMTOKEN">
      <xsd:enumeration value="replace"/>
      <xsd:enumeration value="add"/>
      <xsd:enumeration value="remove"/>
      <xsd:enumeration value="delete"/>
      <xsd:enumeration value="modifyUserData"/>
    </xsd:restriction>
  </xsd:simpleType>
  <!-- -->
  <xsd:complexType name="DeltaModifyType">
    <xsd:annotation>
      <xsd:documentation>
      This element represents modifying an element in a master document in some way, 
      depending on the 'op' attribute.
            
      Attributes:
      
      targetRef:        A URI reference to a placeholder element which represents the
                        element in the master document which will be modified.
                        
      attributeName:    The name of the attribute being modified, if any.
      
      values:           The value or values to be used when modifying the attribute. The way in 
                          which this is used to make the modification is determined by the 
                          'op' attribute. 
                          
      valueRefs:        URI reference to placeholder element(s) which represent
                          elements in the master document; or to elements in Add or Replace
                          blocks in this delta. The attribute being modified is
                          altered to reference these elements, according to the value of the
                          'op' attribute.
                          
      op:               This determines the operation used to make the modification. One of
      
                        'replace'        completely replaces an existing attribute value, with 
                                         the value in 'values' or 'valueRefs'.
                        'add'            adds the values in 'values' or 'valueRefs' to an existing
                                         attribute, for example an integer array, IDREFS or multiple
                                         URI attribute.
                        'remove'         removes the values in 'values' or 'valueRefs' from an
                                         existing attribute.
                        'delete'         deletes an existing attribute entirely.
                        
                        'modifyUserData' merges the UserData of this Modify element into the 
                                         UserData of the target element. 'attributeName' is
                                         not set in this case.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="plm:AttribOwnerBase">
        <xsd:attribute name="targetRef" type="plm:anyURIType" use="optional"/>
        <xsd:attribute name="attributeName" type="xsd:string" use="optional"/>
        <xsd:attribute name="values" type="xsd:string" use="optional"/>
        <xsd:attribute name="valueRefs" type="plm:uriReferenceListType" use="optional"/>
        <xsd:attribute name="op" type="plm:DeltaModifyOpType" default="replace" use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <!-- -->
  <xsd:complexType name="ExternalReferenceType">
    <xsd:annotation>
      <xsd:documentation>
      This element is a reference to an object in an Application data model. At present it 
      identifies the object by containing one or more ApplicationRef sub-elements.
      
      Attributes:
      
      type:           Optional PLMXML type of the external object, e.g. "ProductRevision"
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="plm:DescriptionBase">
        <xsd:attribute name="type" type="xsd:string" use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <!-- -->
  <xsd:complexType name="PLMXMLDeltaType">
    <xsd:annotation>
      <xsd:documentation>
      The top-level element in a PLMXML Delta file. This represents a delta, or change,
      to be applied to a PLMXML file or equivalent Application model (the 'master' file/model).
      
      Attributes:
      
      context:        A URI or other indication of the master Document or model to which 
                      this delta is to be applied.
      
      SubElements:
      
      Add:            Add elements, representing the addition of a tree of elements
      Replace:        Replace elements, representing the replacement of a tree of elements
      Delete:         Delete elements, representing the deletion of trees of elements
      Modify:         Modify elements, representing an alteration to an attribute of
                        an element.
                        
      ExternalReference:    References to Application objects. 
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="plm:DocumentBase">
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
          <xsd:element name="Add" type="plm:DeltaAddType"/>
          <xsd:element name="Replace" type="plm:DeltaReplaceType"/>
          <xsd:element name="Delete" type="plm:DeltaDeleteType"/>
          <xsd:element name="Modify" type="plm:DeltaModifyType"/>
          <xsd:element name="ExternalReference" type="plm:ExternalReferenceType"/>
        </xsd:choice>
        <xsd:attribute name="context" type="xsd:string" use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:element name="PLMXMLDelta" type="plm:PLMXMLDeltaType"/>
  <!-- -->
</xsd:schema>
