Commit 208350b3 authored by Jason Graham's avatar Jason Graham
Browse files

Upload New File

parent 67dfe92c
Loading
Loading
Loading
Loading
+156 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:etsi="http://uri.etsi.org/03280/common/2017/07" xmlns:common="http://uri.etsi.org/03120/common/2016/02/Common" xmlns:core="http://uri.etsi.org/03120/common/2019/10/Core" xmlns="http://uri.etsi.org/03120/common/2022/07/PayloadModSS2" targetNamespace="http://uri.etsi.org/03120/common/2022/07/PayloadModSS2" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import namespace="http://uri.etsi.org/03120/common/2016/02/Common"/>
  <xs:import namespace="http://uri.etsi.org/03120/common/2019/10/Core"/>
  <xs:import namespace="http://uri.etsi.org/03280/common/2017/07"/>
  <xs:complexType name="PayloadModificationProfileObject">
      <xs:complexContent>
          <xs:extension base="core:HI1Object">
              <xs:sequence>
                  <xs:group ref="PayloadModificationProfileObjectGroup"/>
              </xs:sequence>
          </xs:extension>
      </xs:complexContent>
  </xs:complexType>
  <xs:group name="PayloadModificationProfileObjectGroup"><!--May be able to get rid of this level-->
      <xs:sequence>
          <xs:element name="PayloadModificationProfileName" type="etsi:ShortString" minOccurs="0"/>
          <xs:element name="PayloadModifications" type="ListOfPayloadModifications"/>
      </xs:sequence>
  </xs:group>
  <xs:complexType name="ListOfPayloadModifications">
      <xs:sequence>
          <xs:element name="PayloadModification" type="ModificationType" minOccurs="1" maxOccurs="unbounded"/>
      </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ModificationType">
      <xs:choice>
          <xs:element name="sIPHeader" type="SIPHeaderModification"/>
          <xs:element name="sIPBody" type="SIPBodyModification"/>
          <xs:element name="XML" type="XMLModification"/>
      </xs:choice>
  </xs:complexType>

<!--============================-->
<!--= SIP HEADER MODIFICATIONS =-->
<!--============================-->

  <xs:complexType name="SIPHeaderModification">
    <xs:sequence>
      <xs:element name="ListOfSIPHeaders" type="ListOfSIPHeaders"/>
      <!-- Probably need something to select only part of the header, but for now, I will make a specific action for this specific case (redactAccessInfo)-->
      <xs:element name="ListOfSIPHeaderModificationActions" type="ListOfSIPHeaderModificationActions"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ListOfSIPHeaders">
      <xs:sequence maxOccurs="unbounded">
          <xs:element name="SIPHeaderSelection" type="SIPHeaderSelection"/>
      </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SIPHeaderSelection">
      <xs:choice>
          <xs:element name="HeaderName" type="xs:string"/>
      </xs:choice>
  </xs:complexType>
  <xs:complexType name="ListOfSIPHeaderModificationActions">
      <xs:sequence maxOccurs="unbounded">
          <xs:element name="SIPHeaderModificationAction" type="SIPHeaderModificationAction"/>
      </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SIPHeaderModificationAction">
    <xs:choice>
      <xs:element name="redactIP" type="EmptyElement"/>
      <xs:element name="remove" type="EmptyElement"/>
      <xs:element name="replaceWithCharacters" type="xs:string"/>
      <xs:element name="redactAccessInfo" type="EmptyElement"/>
    </xs:choice>
  </xs:complexType>

<!--==========================-->
<!--= SIP BODY MODIFICATIONS =-->
<!--==========================-->

  <xs:complexType name="SIPBodyModification">
      <xs:sequence>
          <xs:element name="ListOfSIPBodies" type="ListOfSIPBodies"/>
          <xs:element name="ListOfSIPBodyModificationActions" type="ListOfSIPBodyModificationActions"/>
      </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ListOfSIPBodies">
      <xs:sequence maxOccurs="unbounded">
          <xs:element name="SIPBodySelection" type="SIPBodySelection"/>
      </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SIPBodySelection">
      <xs:choice>
        <xs:element name="ContentType" type="xs:string"/>
      </xs:choice>
  </xs:complexType>
    <xs:complexType name="ListOfSIPBodyModificationActions">
        <xs:sequence maxOccurs="unbounded">
            <xs:element name="SIPBodyModificationAction" type="SIPBodyModificationAction"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SIPBodyModificationAction">
        <xs:choice>
            <xs:element name="predefined" type="PredefinedPayloadModification"/>
            <xs:element name="remove" type="EmptyElement"/>
            <xs:element name="replaceWithCharacters" type="xs:string"/>
            <xs:element name="replaceWithOctets" type="xs:hexBinary"/>
            <xs:element name="replaceWithBits" type="BitString"/>
        </xs:choice>
    </xs:complexType>
    <xs:complexType name="PredefinedPayloadModification">
        <xs:sequence>
            <xs:element name="ObjectIdentifier" type="core:ObjectIdentifier"/>
        </xs:sequence>
    </xs:complexType>

<!--=====================-->
<!--= XML MODIFICATIONS =-->
<!--=====================-->

  <xs:complexType name="XMLModification">
    <xs:sequence>
      <xs:element name="ListOfXPath" type="ListOfXPath"/>
      <xs:element name="ListOfXMLModificationActions" type="ListOfXMLModificationActions"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ListOfXPath">
    <xs:sequence maxOccurs="unbounded">
      <xs:element name="XPathSelection" type="XPathSelection"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="XPathSelection">
    <xs:choice>
      <xs:element name="XPathString" type="xs:string"/>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="ListOfXMLModificationActions">
    <xs:sequence maxOccurs="unbounded">
      <xs:element name="XMLModificationAction" type="XMLModificationAction"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="XMLModificationAction">
    <xs:choice>
      <xs:element name="predefined" type="PredefinedPayloadModification"/>
      <xs:element name="remove" type="EmptyElement"/>
      <xs:element name="replaceWithCharacters" type="xs:string"/>
    </xs:choice>
  </xs:complexType>

<!--======================-->
<!--= COMMON DEFINITIONS =-->
<!--======================-->
    
    <xs:simpleType name="EmptyElement">
        <xs:restriction base="xs:string">
            <xs:enumeration value=""></xs:enumeration>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="BitString">
        <xs:restriction base="xs:token">
            <xs:pattern value="[0-1]{0,}"/>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>