<?xml version="1.0" encoding="UTF-8"?>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/modules/Common.mod#6 $
-->

<!--
    A few character entities the XML recommendation says should be defined
    "for interoperability" with existing SGML parsers.  By default, these
    are not included to avoid warnings (about entity redefinition) from
    many XML parsers.
-->
<!ENTITY % SGML-help "IGNORE">
<![%SGML-help;[
<!ENTITY lt     "&#38;#60;">
<!ENTITY gt     "&#62;">
<!ENTITY amp    "&#38;#38;">
<!ENTITY apos   "&#39;">
<!ENTITY quot   "&#34;">
]]>

<!--
    Common types used throughout the cXML definition.

    The types try to follow the XML DATA definition submitted to the W3C. See
    the following for more information,

        http://msdn.microsoft.com/xml/reference/schema/datatypes.asp
        http://www.w3c.org/TR/1998/NOTE-XML-data-0105/

-->

<!-- Atomic-level Types -->
<!ENTITY % bin.base64 "CDATA">
<!ENTITY % bin.hex "CDATA">
<!ENTITY % boolean "(0 | 1)">    <!-- 0 is false, 1 is true -->
<!ENTITY % char "CDATA">
<!ENTITY % date "CDATA">
<!ENTITY % datetime.tz "CDATA">  <!-- Time zone is required -->
<!ENTITY % fixed.14.4 "CDATA">
<!ENTITY % i8 "CDATA">
<!ENTITY % int "%i8;">
<!ENTITY % r8 "CDATA">
<!ENTITY % number "CDATA">       <!-- No limit on number of digits, unlike
                                      %r8; -->
<!ENTITY % string "CDATA">
<!ENTITY % time.tz "CDATA">      <!-- Time zone is required -->
<!ENTITY % ui8 "CDATA">
<!ENTITY % uint "%ui8;">         <!-- Unique to this specification -->
<!ENTITY % uri "CDATA">
<!ENTITY % uuid "CDATA">

<!-- Higher-level Types -->
<!--
    NOTE: The following is a temporary *hack* to allow empty values for
    some attributes with these types.  The nmtoken entity should resolve to
    NMTOKEN.
-->
<!ENTITY % nmtoken "CDATA">      <!-- Any combination of XML name chars. -->
<!ENTITY % isoLangCode "%nmtoken;">         <!-- ISO 639 Language Code -->
<!ENTITY % isoCountryCode "%nmtoken;">      <!-- ISO 3166 Country Code -->
<!ENTITY % isoCurrencyCode "%nmtoken;">     <!-- ISO 4217 Currency Code -->
<!ENTITY % xmlLangCode "%nmtoken;"> <!-- Language code as defined by XML
                                         recommendation: Language and
					 country. -->
<!ENTITY % URL "%uri;">
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Base.mod#11 $
-->

<!--
    This file defines the basic elements used to build higher level
    constructs in cXML.
-->

<!-- Basic Name/Data Elements -->
<!--
    Name is used to provide an identifier for other elements.

    xml:lang
        The language in which the name is written.
-->
<!ELEMENT Name (#PCDATA)> <!-- string -->
<!ATTLIST Name
    xml:lang  %xmlLangCode;  #REQUIRED
>

<!--
    An Extrinsic is an element which can be used to extend the data
    associated with known elements.

    Since this Element is of type ANY, it could contain any arbitrary XML
    document within itself, or a binary ![CDATA[]] document.

    name
        Name used to identify this extrinsic.
-->
<!ELEMENT Extrinsic ANY>
<!ATTLIST Extrinsic
    name  %string;  #REQUIRED
>

<!--
    Description is a string which describes something.
    Though text may be interspersed with ShortName elements in this content
    model, placing the ShortName at the beginning or end of the element is
    much preferred.  At most one ShortName element is allowed per
    Description.  The intended content model would be more like
    (( ShortName, #PCDATA ) | ( #PCDATA | ShortName? )) if DTD syntax
    supported it.

    xml:lang
        The language in which the description is written.
-->
<!ELEMENT Description ( #PCDATA | ShortName )* > <!-- mixed: string and
                                                      ShortName -->
<!ATTLIST Description
    xml:lang  %xmlLangCode;  #REQUIRED
>

<!--
    A short string which describes something in fewer characters than the
    entire Description.  This should be used when limited space is available.
    For example, a table of elements might show the ShortName's of each.  A
    linked "details" view would show the entire Description (including the
    ShortName).  Without a ShortName, the user interface must default to a
    truncation of the Description.
    This element does not require an xml:lang attribute since it appears only
    within a Description element.  The language of the ShortName must match
    that of the surrounding Description.
-->
<!ELEMENT ShortName (#PCDATA)> <!-- string -->

<!-- Telephone Number Elements -->
<!--
    International ITU dial code for the country code in question.  This
    code would be entered after any escape code necessary to begin
    International dialing.  That is, the escape code does not appear in the
    content of this element.

    isoCountryCode
        The ISO 3166 2-letter country code for the dial code in question.
-->
<!ELEMENT CountryCode (#PCDATA)> <!-- uint -->
<!ATTLIST CountryCode
    isoCountryCode  %isoCountryCode;  #REQUIRED
>

<!--
    The areacode or city code within a CountryCode.
-->
<!ELEMENT AreaOrCityCode (#PCDATA)> <!-- uint -->

<!--
    The local number part of a telephone number.
-->
<!ELEMENT Number (#PCDATA)> <!-- string -->

<!--
    An extension within relative to the Number element. This element has no
    meaning without an associated Number element.
-->
<!ELEMENT Extension (#PCDATA)> <!-- uint -->

<!--
    TelephoneNumber represents international telephone numbers.
-->
<!ELEMENT TelephoneNumber (CountryCode, AreaOrCityCode, Number, Extension?)>

<!--
     Phone is a "named" TelephoneNumber.

     name
          specifies an identifier which indicates the type of phone number.
          US examples would include "work","home", etc.
-->
<!ELEMENT Phone (TelephoneNumber)>
<!ATTLIST Phone
    name  %string;  #IMPLIED
>

<!--
    Fax number.
-->
<!ELEMENT Fax (TelephoneNumber | URL | Email)>
<!ATTLIST Fax
    name  %string;  #IMPLIED
>

<!-- Addressing Elements -->
<!--
    URL. A string which represents a URL
-->
<!ELEMENT URL (#PCDATA)> <!-- URL -->
<!ATTLIST URL
    name  %string;  #IMPLIED
>

<!--
    An email address. Address must conform to RFC 821 (SMTP Standard).
-->
<!ELEMENT Email (#PCDATA)> <!-- string -->
<!ATTLIST Email
    name  %string;  #IMPLIED
>

<!--
    Contact represents an entity at a location. The nature of this
    element is that it represents a communication "end point" for a
    location.

    role
        Position this person or group plays in the procurement process.
        Likely values include endUser, administrator, purchasingAgent,
        technicalSupport, customerService, sales,
        supplierCorporate, supplierMasterAccount, supplierAccount,
        buyerCorporate, buyerMasterAccount, buyerAccount, buyer,
        subsequentBuyer. Other values may be allowed in some cases.

        from and to roles are reserved for future use.

    addressID
        An id for the address. Needed to support address codes for
        relationships that require id references.
-->
<!ELEMENT Contact (Name, PostalAddress*, Email*, Phone*, Fax*, URL*)>
<!ATTLIST Contact
    role             NMTOKEN           #IMPLIED
    addressID        %string;          #IMPLIED
>

<!--
    The DeliverTo part of an Address. This would be internal to the actual
    address know to the outside world. Similar to what an extension is to a
    TelephoneNumber.
-->
<!ELEMENT DeliverTo (#PCDATA)> <!-- string -->

<!--
    Street is a single line of an Address' location.
-->
<!ELEMENT Street (#PCDATA)> <!-- string -->

<!--
    City is the name of the city in an Address' location.
-->
<!ELEMENT City (#PCDATA)> <!-- string -->

<!--
    State is an optional state identifier in an Address' location.
-->
<!ELEMENT State (#PCDATA)> <!-- string -->

<!--
    PostalCode (I have no idea how to describe it)
-->
<!ELEMENT PostalCode (#PCDATA)> <!-- string -->

<!--
    Country is the name of the country in an Address' location.  The
    content of this element is a string which may (for example) be printed
    directly to a shipping label.  The content is the human-readable
    equivalent of the isoCountryCode used by applications.

    isoCountryCode
        The ISO 3166 2-letter country code for this country.
-->
<!ELEMENT Country (#PCDATA)> <!-- string -->
<!ATTLIST Country
    isoCountryCode  %isoCountryCode;  #REQUIRED
>

<!--
    PostalAddress is a real-world location for a business or person.
-->
<!ELEMENT PostalAddress (DeliverTo*, Street+, City, State?,
                         PostalCode?, Country)>
<!ATTLIST PostalAddress
    name  %string;  #IMPLIED
>

<!--
    Address is the association of a Contact and an Location.

    isoCountryCode
        The ISO 3166 2-letter country code for the country containing this
        location.

    addressID
        An id for the address.  Needed to support address codes for
        relationships that require id references.  An example would be a
        shipping code.
-->
<!ELEMENT Address (Name, PostalAddress?, Email?, Phone?, Fax?, URL?)>
<!ATTLIST Address
    isoCountryCode  %isoCountryCode;  #IMPLIED
    addressID       %string;          #IMPLIED
>

<!-- Financial Elements -->
<!--
    Money is the representation of the object used to pay for items.

    currency
        specifies the currency in which amount is stated, must conform to ISO
        4217 currency codes.

    alternateAmount
        the amount of money in the alternateCurrency. Optional and used to
        support dual-currency requirements such as the Euro.

    alternateCurrency
        specifies the currency in which the alternateAmount is stated, must
        conform to ISO 4217 currency codes.
-->
<!ELEMENT Money (#PCDATA)> <!-- number -->
<!ATTLIST Money
    currency           %isoCurrencyCode;  #REQUIRED
    alternateAmount    %number;           #IMPLIED
    alternateCurrency  %isoCurrencyCode;  #IMPLIED
>

<!--
    Optional textual child for communicating arbitrary comments or
    description along with the parent.
    Though text may be interspersed with Attachment elements in this content
    model, grouping the Attachment list at the begging or end of the element
    is much preferred.  The intended content model would be more like
    (( Attachment+, #PCDATA ) | ( #PCDATA | Attachment* )) if the DTD syntax
    supported it.

    xml:lang
        The language in which the Comments are written.  This attribute
    will be required in a future version of cXML.  (Leaving it out is
    deprecated.)
-->
<!ELEMENT Comments ( #PCDATA | Attachment )* > <!-- mixed: string and
                                                    opt. Attachment list -->
<!ATTLIST Comments
    xml:lang  %xmlLangCode;  #IMPLIED
>

<!--
    Optional child of Comments element referencing a part in a multipart MIME
    transmission.

    The contained URL must use the scheme "cid:".  This is the identifier for
    the referenced attachment within the larger transmission.  Must match the
    Content-ID header of one (and only one) part of the MIME transmission
    containing this cXML document.  May also be used to retrieve the
    attachment file separately.
-->
<!ELEMENT Attachment (URL)>

<!---
    Reference to a remote attachment. 

    AttachmentReference is used inside Extrinsic elements that have a
    predefined name of "Attachments".

    In the context of AttachmentReference, the domain attribute of
    InternalID is currently optional. However, as a way to prevent
    circular request paths, the sending application may use a
    predefined value of "local" to indicate that the attachment
    requested is local to the other application.
	
    length
        length of the attachment in bytes.
-->
<!ELEMENT AttachmentReference (Name, Description, InternalID)>
<!ATTLIST AttachmentReference
    length  %uint;  #IMPLIED
>

<!--
    Price per unit of item.
-->
<!ELEMENT UnitPrice (Money)>

<!--
    Reference to an earlier document (for example, OrderRequest).  In a
    StatusUpdateRequest, this element identifies the purchase order to be
    updated.

    payloadID
        A unique identifier for the document.  Copied directly from the
        cXML element of the original document.
-->
<!ELEMENT DocumentReference EMPTY>
<!ATTLIST DocumentReference
    payloadID       %string;      #REQUIRED
>

<!ELEMENT InternalID (#PCDATA)> <!-- string -->
<!ATTLIST InternalID
    domain   %string;  #IMPLIED
>

<!-- ====
    Common to most variants of the PunchOut transaction set.  Defined here
    to be easily shared between multiple DTD files without requiring
    inclusion of Transaction.mod in all of them.

    All of the PunchOut transaction sets include an originating Request
    (ProviderSetupRequest for example), relatively simple Response
    (PunchOutSetupResponse for example) and final Message
    (ProviderDoneMessage or PunchOutOrderMessage).  The Request and
    Response comprise a back-end transaction between two cooperating
    applications that wish to extend an interactive session from one to the
    other.  The Request provides the destination application with
    authentication, identification and other setup information.  The
    Response provides the originating application with a unique starting
    location for the interactive (HTML) session at the destination system.

    After receiving a Response of this type, the originating application
    redirects the user's browser to the provided location.  (For some
    non-HTML applications, opening a new browser window at that location
    may be more appropriate.)  The destination system eventually provides
    an HTML form to the user's browser.  This form submits the final
    Message to close the remote session, return that user to the
    originating application and carry any required information back to the
    originating application.
==== -->

<!--
    OriginatorCookie - Identification of a specific PunchOut session.  Used
    in both originating Request and later Message that returns user to
    originating application.

    Note: The BuyerCookie element used in a 'regular' PunchOut transaction
    (defined in Transaction.mod) is of type ANY.  That does not seem
    useful.  The string required below better matches the needs for this
    element.  Future transactions similar to the PunchOut transaction will
    use this element.
-->
<!ELEMENT OriginatorCookie (#PCDATA)>

<!--
    BrowserFormPost - Location to which the user's browser must submit the
    final Message.  This location (carried in the originating Request) does
    not need to be specific to a PunchOut session since the
    OriginatorCookie is returned in the Message.
-->
<!ELEMENT BrowserFormPost (URL)>

<!--
    SelectedService - Identification of a service offered by this provider
    and requested in this transaction.  Used only in the originating
    Request.
-->
<!ELEMENT SelectedService (#PCDATA)>

<!--
    StartPage - Location to which the user's browser must be redirected to
    begin the interactive portion of the session at the remote site.  The
    destination system returns this information in the Response document.
    This location must be specific to a particular session.  It is
    effectively a one time key, providing authenticated entry into the
    destination system.
-->
<!ELEMENT StartPage (URL)>

<!--
    ReturnData - Any information the originator must know about the
    completed operation at the provider site.  The ReturnValue is for
    applications; the Name is for human consumption (direct presentation in
    the User Interface of the application).  Where appropriate for the
    possible services, this element may appear in the final Message for a
    PunchOut session.

    name
        An identifier for the data returned.  Provides a meaning for the
        contents of a ReturnData element.
-->
<!ELEMENT ReturnData (ReturnValue, Name)>
<!ATTLIST ReturnData
    name  %string;  #IMPLIED
>

<!ELEMENT ReturnValue (#PCDATA)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/modules/Version.mod#4 $
-->

<!--
     Another top-level entity used in Transport.mod.  Defined here to allow
     easy updates to the release version of cXML without opening
     Transport.mod.  This should also provide an easy file to search for
     the current release version string.
-->

<!-- cxml.version
    Current default string for the cXML@version attribute.  Corresponds to
    the final directory of the SYSTEM identifier used in all up-to-date
    cXML documents.
    For easy parsing of this file, do not remove whitespace surrounding the
    actual version string.
-->
<!ENTITY cxml.version "1.2.009" >
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Supplier.mod#7 $
-->

<!--
    Supplier of goods and services. Includes a list of SupplierIDs which
    identify the Supplier.

    corporateURL
        URL to web site about the supplier

    storeFrontURL
        URL to web site where a user can shop or browse
-->
<!ELEMENT Supplier (Name, Comments?, SupplierID+, SupplierLocation*)>
<!ATTLIST Supplier
    corporateURL   %URL;  #IMPLIED
    storeFrontURL  %URL;  #IMPLIED
>

<!--
    One of the locations for a supplier. Supplier location is
    generally a physical location.
-->
<!ELEMENT SupplierLocation (Address, OrderMethods)>

<!--
    OrderMethods is the list of methods by which one can order
    from a supplier. The contact element is the technical contact
    who should be able to assist with order processing issues.
    The list is to be ordered by supplier preference, the first
    element having the highest degree of preference.
-->
<!ELEMENT OrderMethods (OrderMethod+, Contact?)>

<!--
    OrderMethod is a method for ordering. It is comprised of a
    target address for the order and the protocol expected by
    the address.
-->
<!ELEMENT OrderMethod (OrderTarget, OrderProtocol?)>

<!--
    OrderTarget represents an address to which orders can be
    sent.
-->
<!ELEMENT OrderTarget (Phone | Email | Fax | URL | OtherOrderTarget)>

<!--
    OrderProtocol is the communication method to be used when
    communicating an order to a supplier. An example would be "cXML".
-->
<!ELEMENT OrderProtocol (#PCDATA)> <!-- string -->

<!--
    OtherOrderTarget represents an address which is not enumerated by
    default in the OrderTarget Element. This may contain address targets
    beyond the ability of this document to describe.

    name
        Optional name for target.
-->
<!ELEMENT OtherOrderTarget ANY>
<!ATTLIST OtherOrderTarget
    name  %string;  #IMPLIED
>

<!--
    Definition of a supplier id.  A supplier id is a (domain, value)
    pair so that suppliers have the flexibility to define their id's
    according to an arbitrary convention (e.g., (DUNS, 12345),
    (TaxID, 88888888)).

    domain
        the domain of the id
-->

<!ELEMENT SupplierID (#PCDATA)> <!-- string -->
<!ATTLIST SupplierID
    domain  %string;  #REQUIRED
>
<!--
   Defines a List of Suppliers that might be associated with a quote Item. Used in
   ItemOut. 
-->
<!ELEMENT SupplierList (Supplier+)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/modules/Item.mod#6 $
-->

<!--
    Must be a UN/CEFACT (Recommendation 20) unit of measure code.
-->
<!ELEMENT UnitOfMeasure (#PCDATA)> <!-- nmtoken -->

<!--
    ID with which the item's manufacturer identifies the item.
-->
<!ELEMENT ManufacturerPartID (#PCDATA)> <!-- string -->

<!--
    Name of the item's manufacturer.

    xml:lang
        The language in which the ManufacturerName is written.  This
    attribute will be required in a future version of cXML.  (Leaving it
    out is deprecated.)
-->
<!ELEMENT ManufacturerName (#PCDATA)> <!-- string -->
<!ATTLIST ManufacturerName
    xml:lang %xmlLangCode; #IMPLIED
>

<!--
    Classification is used to group items into similar categories.

    domain
        "name" of classification, ie., SPSC
-->
<!ELEMENT Classification (#PCDATA)> <!-- string -->
<!ATTLIST Classification
    domain  %string;  #REQUIRED
>

<!--
    How the supplier identifies an item they sell.

    If SupplierPartID does not provide a unique key to identify the item,
    then the supplier should generate a key which identifies the part
    uniquely when combined with the SupplierID and SupplierPartID. The
    key is called SupplierPartAuxiliaryID.

    An example is where a Supplier would use the same PartID for an
    item but have a different price for units of "EA" versus "BOX".
    In this case, the ItemIDs should be:
    <ItemID>
        <SupplierPartID>pn12345</SupplierPartID>
        <SupplierPartAuxiliaryID>EA</SupplierPartAuxiliaryID>
    </ItemID>
    <ItemID>
        <SupplierPartID>pn12345</SupplierPartID>
        <SupplierPartAuxiliaryID>
           <foo>well formed XML here</foo>
        </SupplierPartAuxiliaryID>
    </ItemID>
    In this case, the "foo" element must be defined in an internal subset
    sent with the cXML document.  Otherwise, parsers will not be able to
    validate that document.

    In a preferred approach, the sending application may escape the contained
    XML using CDATA sections.  This would appear as:
       ...
       <SupplierPartAuxiliaryID>
           <![CDATA[<foo>well formed XML here</foo>]]>
       </SupplierPartAuxiliaryID>
       ...

    Finally, the angle brackets could be escaped using XML character
    entities.  This might be a bit harder for humans to read.  For example:
       ...
       <SupplierPartAuxiliaryID>
           &lt;foo&gt;well formed XML here&lt;/foo&gt;
       </SupplierPartAuxiliaryID>
       ...
-->
<!ELEMENT SupplierPartID (#PCDATA)> <!-- string -->

<!ELEMENT SupplierPartAuxiliaryID ANY>

<!--
    A unique identification of an item. SupplierID is not required since
    ItemIDs never travel alone.
-->
<!ELEMENT ItemID (SupplierPartID, SupplierPartAuxiliaryID?)>

<!--
    ItemDetail contains detailed information about an item. All the data that
    a user would want to see about an item instead of the bare essentials
    that are represented in the ItemID.
-->
<!ELEMENT ItemDetail (UnitPrice, Description+, UnitOfMeasure,
                      Classification+, ManufacturerPartID?,
                      ManufacturerName?, URL?, Extrinsic*)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Transaction.mod#18 $
-->

<!--
    For better definitions of these Elements/Entities, refer to the cXML
    Transaction Specification documents.
-->

<!-- Basic transactional elements used throughout -->
<!--
    The total for something.
-->
<!ELEMENT Total (Money)>

<!--
    The bill to for an item.
-->
<!ELEMENT BillTo (Address)>

<!--
    The ship to for a item.
-->
<!ELEMENT ShipTo (Address)>

<!--
    Definition of a cXML Shipping item. Represents a shipping cost in the
    shopping basket (PunchOutOrderMessage) or an order to the supplier
    (OrderRequest). There could be one of these for the entire order, or one
    per lineitem.

    trackingDomain
        represents the logistics supplier, I.E., "FedEx", "UPS", etc.

    trackingId
        an optional element value that represents the logistics supplier
        tracking number

    tracking
        Deprecated - Do Not Use
-->
<!ELEMENT Shipping (Money, Description)>
<!ATTLIST Shipping
    trackingDomain  %string;  #IMPLIED
    trackingId      %string;  #IMPLIED
    tracking        %string;  #IMPLIED
>

<!--
    Defines a Purchasing Card element used for payment
-->
<!ELEMENT PCard (PostalAddress?)>
<!ATTLIST PCard
    number      %number;  #REQUIRED
    expiration  %date;    #REQUIRED
    name        %string;  #IMPLIED
>

<!--
    The list of valid payment types.
-->
<!ENTITY % cxml.payment  "PCard">
<!ELEMENT Payment (%cxml.payment;)>

<!--
    Defines an accounting segment.  Segment is an older, deprecated way to
    transport this information.

    type
        The accounting type of this segment.

    id
        The unique key of this Segment against the type.

    description
        Textual description of the Segment. For human readability.
-->
<!ELEMENT Segment EMPTY>
<!ATTLIST Segment
    type         %string;  #REQUIRED
    id           %string;  #REQUIRED
    description  %string;  #REQUIRED
>

<!--
    Defines an accounting segment.  AccountingSegment is the newer, better
    way to transport this information.  Name corresponds to the type
    attribute of Segment; Description corresponds to description.  Both add
    required locale attributes to the strings.

    id
        The unique key of this Segment against the type.
-->
<!ELEMENT AccountingSegment ( Name, Description )>
<!ATTLIST AccountingSegment
    id           %string;  #REQUIRED
>

<!--
    An accounting object.  Use of the Segment element here is deprecated.

    name
        The name of the object containing the specified accounting segments.
-->
<!ENTITY % cxml.accounting  "( Segment+ | AccountingSegment+ )">
<!ELEMENT Accounting (%cxml.accounting;)>
<!ATTLIST Accounting
    name  %string;  #REQUIRED
>

<!--
    A charge against an Accounting element.
-->
<!ELEMENT Charge (Money)>

<!--
    The combination of a Charge against an Accounting Element. A distribution
    represents the breakdown of one overall amount into sub-amounts.
-->
<!ELEMENT Distribution (Accounting, Charge)>

<!ELEMENT TaxAmount (Money)>

<!ELEMENT TaxableAmount (Money)>

<!--
    One language-specific string for the location of tax,
    e.g. London, Canada, California, etc.

    xml:lang
        The language or locale in which the location of tax is written.
-->
<!ELEMENT TaxLocation (#PCDATA)>              <!-- string -->
<!ATTLIST TaxLocation
   xml:lang              %xmlLangCode;         #REQUIRED
>

<!--

    TriangularTransactionLawReference indicates the relevant law as
    titled for the local jurisdiction in the scenario of a triangular
    transaction.  ex: Triangulation, article 28c,E paragraph 3 of the
    6th EU VAT Directive

    xml:lang
        the language in which the law reference is written.
-->
<!ELEMENT TriangularTransactionLawReference (#PCDATA)>
<!ATTLIST TriangularTransactionLawReference
    xml:lang   %xmlLangCode;    #REQUIRED
>

<!--
    Defines details of one type of tax.

    TaxableAmount
       The taxable amount.

    TaxAmount
       The tax amount.

    TaxLocation
       The tax location.

    Description
       The textual description of the current type of tax.

    TriangularTransactionLawReference
       The law reference for transactions where isTriangularTransaction is True

    purpose
       The purpose of the tax, e.g., tax (tax), custom duty, etc.

    category
       The tax category, Sales tax (sales), Use tax (usage), VAT (vat),
       GST (gst) are defined categories. Other values are permitted.

    percentageRate
       The tax rate in number of percentage.

    isVatRecoverable
       True if the VAT is recoverable.  Default is false.

    taxPointDate
       refers to the date on which VAT becomes due.

    paymentDate
       indicate the date when payment must be made.

    isTriangularTransaction
       True if the transaction is triangular.  Default is false.
-->
<!ELEMENT TaxDetail (TaxableAmount?, TaxAmount, TaxLocation?, Description?,
                     TriangularTransactionLawReference?)>
<!ATTLIST TaxDetail
    purpose                 %string;       #IMPLIED
    category                %string;       #REQUIRED
    percentageRate          %r8;           #IMPLIED
    isVatRecoverable        (yes)          #IMPLIED
    taxPointDate            %datetime.tz;  #IMPLIED
    paymentDate             %datetime.tz;  #IMPLIED
    isTriangularTransaction (yes)          #IMPLIED
>

<!--
    Definition of a cXML Tax item. This represents what a Tax element should
    be in the classic notion of a line on a PO or Invoice. It can also
    represent a per-lineitem tax element depending on where it appears
    (inside of a item ELEMENT or inside of a something like a supplierOrder
    ELEMENT).

    Represents a tax item in the shopping basket. There could be one of these
    for the entire order, or one per lineitem.
-->
<!ELEMENT Tax (Money, Description, TaxDetail*)>

<!-- Item Elements -->
<!--
    The representation of a line item as it needs to be for sending to a
    supplier.

    quantity
        How many items are desired.
    lineNumber
        Position (counting from 1) of this item in an order.  Used to
        maintain a reference between items in create and update OrderRequest
        documents.
    requisitionID
        The buyers system requisition id for this line item. It might be the
        same as orderID, and it might not be included at all.  Must not be
        included if requisitionID is specified in the OrderRequestHeader.
    requestedDeliveryDate
        The date this item was requested for delivery.
    agreementItemNumber 
        The corresponding Item Number of the Item in the Master Agreement if this is 
	a 'release' order item.
-->
<!ELEMENT ItemOut (ItemID, Path?, ItemDetail?, (SupplierID | SupplierList)?, ShipTo?, Shipping?,
                   Tax?, Distribution*, Contact*, Comments?)>
<!ATTLIST ItemOut
    quantity               %r8;      #REQUIRED
    lineNumber             %uint;    #IMPLIED
    requisitionID          %string;  #IMPLIED
    agreementItemNumber	   %string;  #IMPLIED
    requestedDeliveryDate  %date;    #IMPLIED
    isAdHoc                (yes)     #IMPLIED
>

<!--
    The representation of a line item as it needs to be for sending to a
    buyer.

    quantity
        How many items are desired.
    lineNumber
        Position (counting from 1) of this item in an order.  Used to
        maintain a reference between items in create and update OrderRequest
        documents.
-->
<!ELEMENT ItemIn (ItemID, Path?, ItemDetail, SupplierID?, ShipTo?, Shipping?, Tax?)>
<!ATTLIST ItemIn
    quantity   %r8;      #REQUIRED
    lineNumber %uint;    #IMPLIED
>

<!--
    StatusUpdate for Confirmation (type=RequestToPay) request.

    transactionTimestamp
        time when the XMLPay transaction was submitted

    transactionID
        an identifier assisgned to the transaction by the payment processing gateway

    authorizationID
        the authorization code for the transaction provided by the bank

    isFailed
        should have a status code greater than zero.  Zero implies a successful transaction.
-->
<!ELEMENT PaymentStatus (PCard, Total, Shipping?, Tax?, Extrinsic*)>
<!ATTLIST PaymentStatus
    orderID    %string;    #REQUIRED
    transactionTimestamp    %datetime.tz;    #REQUIRED
    type    (Authorization| Settlement| Sale| Credit)    #REQUIRED
    isFailed   (yes)    #IMPLIED
    transactionID    %string;    #IMPLIED
    authorizationID    %string;    #IMPLIED
>

<!--
	Partial amount paid against an InvoiceDetail request. Used in InvoiceStatus.
	If this element exists in an InvoiceStatus element, it should mean that the buyer
	does not pay the full amount as the InvoiceDetail request specified. 
-->
<!ELEMENT PartialAmount (Money)>

<!--
	StatusUpdate for InvoiceDetail request.

	PartialAmount
		The partial amount paid against the InvoiceDetail document.

	Comments
		Comments associated with the status update.

	type
		Type of the invoice status. "reconciled" means that the InvoiceDetail request
		has been received and reconciled. "rejected" means that the InvoiceDetail
		request has been rejected. "paid" means that the InvoiceDetail request has
		been paid.
-->

<!ELEMENT InvoiceStatus (PartialAmount?, Comments*)>
<!ATTLIST InvoiceStatus
	type	(reconciled | rejected | paid)		#REQUIRED
>
	
<!-- OrderRequest* Elements -->
<!--
    Definition of an order.  This is the data that is sent to the supplier
    to have them place an order in their order management system. The new
    world order equivalent of a PO.
-->
<!ELEMENT OrderRequest (OrderRequestHeader, ItemOut+)>

<!--
    Header of an order.  This is the data that is sent to the supplier
    to have them place an order in their order management system. Money
    represents the total amount of this order.

    orderID
        The buyer system orderID for this request. Basically, what the PO
        number is today.

    orderVersion
        The buyer system order version number for this request. Relevant when
        the OrderRequest represents a change order request. The version number
        for the original document should be 1 and should be incremented by 1 for
        each subsequent version (2,3,4...).

    isInternalVersion
        A value of yes indicates that this OrderRequest is a version whose changes from
        the previous version are deemed internal to the buyer system. Relevant when the
        version being sent to the supplier is not the first version.

    orderDate
        The date and time the order request was created.

    type
        The type of the order request. Defaults to "new".

    requisitionID
        The buyers system requisition id for this entire order. It might be
        the same as orderID, and it might not be included at all.  Must not
        be included if requisitionID is specified in any ItemOut elements.

    shipComplete
        Optional preference for "hold until complete" processing.  Defaults
        to shipping when available if not specified.  Future versions of the
        protocol may extend the datatype of this attribute to include
        additional possible values (such as "unlessGreatlyBackOrdered"?).
    orderType
        "release", indicates that this is a Release Order from an existing
	Master Agreement/ Contract. Default is regular.
    agreementID
        Identifies associated agreement corresponding to the Release Order.
	At an implementation level it has to be validated that if the orderType
	is 'release' then the appropriate agreementID is also provided.
    agreementPayloadID
        Optional PayloadID for the corresponding Master Agreement.


    The contained DocumentReference element would appear in a document only
    when the type is "update" or "delete".  In that case, the
    DocumentReference would reference the most recent OrderRequest document
    for the order.  For example when an order is created, updated and then
    deleted, the final document should contain a DocumentReference
    referring to the OrderRequest with type="update".  That document would,
    in turn, refer to the original (type="new") OrderRequest document.
-->
<!ELEMENT OrderRequestHeader (Total, ShipTo?, BillTo, Shipping?, Tax?,
                              Payment?, Contact*, Comments?, Followup?,
                              DocumentReference?, Extrinsic*)>
<!ATTLIST OrderRequestHeader
    orderID    %string;        #REQUIRED
    orderDate  %datetime.tz;   #REQUIRED
    orderType  (release| regular) "regular"
    type       (new | update | delete)  "new"
    orderVersion %number;      #IMPLIED
    isInternalVersion  (yes)   #IMPLIED
    agreementID %string;       #IMPLIED
    agreementPayloadID %string; #IMPLIED
    requisitionID   %string;   #IMPLIED
    shipComplete    (yes)      #IMPLIED
>
<!--
    Definition of a Master Agreement.  This is the electronic document representing the 
    Master Agreement that was created and agreed upon in the Buying organizations.
-->
<!ELEMENT MasterAgreementRequest (MasterAgreementRequestHeader, AgreementItemOut*)>

<!--
   Header of an Agreement.  This is the header level information in the Agreement.
   agreementID
	 The buyer system agreementID for this request.  the Master Agreement Number in Buyer.
   agreementDate
	 The date and time the agreement request was created. 
	 This is different from the effective and expiry date of the agreement.
   agreementType
	 Identifies if this is a Value based agreement or quantity based Agreement.
   requestType
	 The type of the agreement request. Defaults to "new".
   effectiveDate
         Date the Master Agreement is available for ordering/releases.
   expirationDate
         Date the Master Agreement is no longer available.
   parentAgreementPayloadID
	 PayloadID for the corresponding parent document that this agreement is derived from.
   operation: 
	"delete" operation will be used to cancel an existing Master Agreement, the
	 assumption here is that the delete request will be an exact replica of the 
	 original request.
	 "new" operation identifies a new MasterAgreement transaction.
	 "update" operation identified an update to an existing transaction. 
	 the DocumentReference attribute should be used to indicate the Orignal
	 Document information.
   Note: 
	 Use "Contact" element to supply any additional Address or Location information.
-->

<!ELEMENT  MasterAgreementRequestHeader (MaxAmount?, MinAmount?, 
					 MaxReleaseAmount?, MinReleaseAmount?, 
					 Contact*,Comments?, DocumentReference?,  Extrinsic*)> 
<!ATTLIST MasterAgreementRequestHeader
    agreementID    %string;		   #REQUIRED
    agreementDate  %datetime.tz;	   #REQUIRED
    type	   (value | quantity)	   "value"
    effectiveDate  %datetime.tz;	   #REQUIRED
    expirationDate %datetime.tz;	   #REQUIRED
    parentAgreementPayloadID %string;      #IMPLIED
    operation      (new | update | delete) "new"
>

<!--
    The representation of a  agreement line item as it needs to be for sending to a
    supplier.
    maxQuantity 
          maximum quantity for this particular lineItem
    minQuantity 
          minimum quantity for this particular lineItem
    maxReleaseQuantity 
          maximum quantity per release for this particular lineItem
    minReleaseQuantity 
          minimum quantity per release for this particular lineItem

    Note :
	  The #lineNumber attribute in the <ItemOut> will be used to specify the corresponding 
	  lineNumber on the Master Agreement in the Procurement Application.
	  At an implementation, level checks should be made to validate this.
    Note :
	  The quantity attribute in the ItemOut tag should be set to one and ignored at 
	  the Mater Agreement implementation processing stage. 
    Note :
	  The MaxReleaseAmount/Quantity and MinReleaseAmount/Quantity at an item level i
	  indicate the ItemLevel amounts and quantities per release.
-->
<!ELEMENT AgreementItemOut (MaxAmount?, MinAmount?, MaxReleaseAmount?, MinReleaseAmount?, ItemOut)>
<!ATTLIST AgreementItemOut
   maxQuantity		%r8;      #IMPLIED
   minQuantity		%r8;      #IMPLIED
   maxReleaseQuantity	%r8;      #IMPLIED
   minReleaseQuantity	%r8;      #IMPLIED
>

<!--
    The maximum amount  for something.
-->
<!ELEMENT MaxAmount (Money)>

<!--
    The minimum amount  for something.
-->
<!ELEMENT MinAmount (Money)>

<!--
    The contractual maximum amount per Release of this Master Agreement.
-->
<!ELEMENT MaxReleaseAmount (Money)>

<!--
 The contractual minimum amount per Release of this Master Agreement
-->
<!ELEMENT MinReleaseAmount (Money)>


<!-- Followup

     Location to which future StatusUpdateRequest documents should be
     posted.  In general, this is the input location for any later
     documents which reference the current OrderRequest document.
-->
<!ELEMENT Followup (URL)>

<!-- PunchOut* Elements -->
<!--
    Definition of a PunchOut Setup Request.  This is the data that is sent
    to the external system that the procurement application is going to
    extract catalog data from.

    The BrowserFormPost element contains the URL we would like the browser
    re-directed to when the PunchOut shopping experience is finished (where
    the PunchOutOrder message should be returned).
-->
<!ELEMENT PunchOutSetupRequest (BuyerCookie, Extrinsic*, BrowserFormPost?,
                                Contact*, SupplierSetup?, ShipTo?,
                                SelectedItem?, ItemOut*)>
<!ATTLIST PunchOutSetupRequest
    operation  (create | inspect | edit | source)  #REQUIRED
>

<!ELEMENT BuyerCookie ANY> <!-- any valid XML data -->

<!ELEMENT SelectedItem (ItemID)>
<!ELEMENT SupplierSetup (URL)>

<!ELEMENT PunchOutSetupResponse (StartPage)>

<!--
    Definition of a PunchOut Order Message.  This is the data that is sent
    back to the procurement application from the external system that the
    PunchOut Request was targeted at.
-->
<!ELEMENT PunchOutOrderMessage (BuyerCookie, PunchOutOrderMessageHeader,
                                ItemIn*)>

<!--
     Header of a PunchOut Order Request.  This is the data that is sent from
     the supplier to transfer the supplier acquired shopping basket back to
     the buyer system.

     operationAllowed
          Highest operation allowed on the PunchOut shopping basket.
          "create" allows only later OrderRequest operations on these items.
          "inspect" adds a PunchOutSetupRequest with operation="inspect".
          And, "edit" allows operation="edit" in that later Setup request.

     quoteStatus 
          "pending"  - Identifies that the transaction is still pending
	  "final" - Identifies that the transaction is complete
-->
<!ELEMENT PunchOutOrderMessageHeader (SourcingStatus?, Total, ShipTo?, Shipping?, Tax?)>
<!ATTLIST PunchOutOrderMessageHeader
    operationAllowed  (create | inspect | edit)  #REQUIRED
    quoteStatus (pending|final) "final"
>

<!-- ====
    Other small Request elements.
==== -->

<!--
    Request to update the status of an earlier transaction.
-->
<!ENTITY % cxml.statuses  "(PaymentStatus |
			    SourcingStatus | InvoiceStatus)">
<!ELEMENT StatusUpdateRequest  (DocumentReference, Status, (%cxml.statuses;)?)>

<!--
    Request to forward a cXML document to another party.  This Request
    occurs in multiple DTD files and is used depending on where (in which
    DTD) the forwarded message resides.
-->
<!ELEMENT CopyRequest (cXML)>
<!--
    Status for a pre-existing sourcing transaction. The textual content indicates
    the display information. "action" attribute defines the context of this message
    based on the value.

    approve : Approve the pending transaction
    deny : deny pending transaction
    cancel : cancel any preexisting transaction.

-->
<!ELEMENT SourcingStatus (#PCDATA)>
<!ATTLIST SourcingStatus
action    (approve | cancel | deny )  #IMPLIED
xml:lang %xmlLangCode; #REQUIRED>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Entities.mod#4 $
-->

<!--
     Top-level entities used in Transport.mod.  Defined here to allow easy
     extention of the cXML specification (using additional DTDs) without
     redefining these entities.
-->

<!-- cxml.messages
     Possible elements (for particular situations) within Message.  These
     are all of the messages defined in the base cXML protocol.
-->
<!ENTITY % cxml.messages "(PunchOutOrderMessage |
                           ProviderDoneMessage |
                           SubscriptionChangeMessage |
                           DataAvailableMessage |
                           SupplierChangeMessage)"
>

<!-- cxml.requests
     Possible elements (for particular situations) within Request.  These
     are all of the requests defined in the base cXML protocol.
-->
<!ENTITY % cxml.requests "(ProfileRequest |
                           OrderRequest |
			   MasterAgreementRequest|
                           PunchOutSetupRequest |
                           ProviderSetupRequest |
                           StatusUpdateRequest |
                           GetPendingRequest |
                           SubscriptionListRequest |
                           SubscriptionContentRequest |
                           SupplierListRequest |
                           SupplierDataRequest |
                           CopyRequest |
                           CatalogUploadRequest |
                           AuthRequest)"
>

<!-- cxml.responses
     Possible elements (for particular situations) within Response.  These
     are all of the responses (corresponding to a subset of the possible
     requests) defined in the base cXML protocol.
-->
<!ENTITY % cxml.responses "(ProfileResponse |
                            PunchOutSetupResponse |
                            ProviderSetupResponse |
                            GetPendingResponse |
                            SubscriptionListResponse |
                            SubscriptionContentResponse |
                            SupplierListResponse |
                            SupplierDataResponse |
                            AuthResponse)"
>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Profile.mod#6 $
-->

<!--
    Request for the latest profile from the server.  May also be used as
    a 'ping' transaction (to check if the server is available).
-->
<!ELEMENT ProfileRequest EMPTY >

<!--
    Static profile response describing the transactions supported by this
    server.  The content should not change frequently.

    effectiveDate
        When these services were first available.  Should not be in the
    future since new clients may need to interact with a server.

    lastRefresh
        When service information was last received from the end server.

    a-dtype
        Datatype enumeration for the attributes of this element.  May be
    ignored by most XML parsers (used for documentation purposes).
-->
<!ELEMENT ProfileResponse ( Option*, Transaction+ )>
<!ATTLIST ProfileResponse
    effectiveDate %datetime.tz; #REQUIRED
    lastRefresh %datetime.tz; #IMPLIED
    a-dtype NMTOKENS #FIXED 'effectiveDate dateTime.tz
                             lastRefresh dateTime.tz'
>


<!--
    Value for a defined option (either for the overall service or a
    specific transaction.  At this time, no options are defined at either
    level.

    name
        The name of this option.  Future versions of cXML will define
    values for this attribute.  This is not intended to be viewed
    directly (the profile is intended mostly for machine consumption).

    a-dtype
        Datatype enumeration for the attributes of this element.  May be
    ignored by most XML parsers (used for documentation purposes).
-->
<!ELEMENT Option ( #PCDATA )>   <!-- string -->
<!ATTLIST Option
    name          %string;      #REQUIRED
    a-dtype       NMTOKENS      #FIXED 'name string'
>

<!--
    A transaction supported by this server.

    requestName
        A specific request this server accepts at the given URL.  The
    %cxml.requests entity (defined in transport.mod) contains the
    possible values for this attribute.

    a-dtype
        Datatype enumeration for the attributes of this element.  May be
    ignored by most XML parsers (used for documentation purposes).
-->
<!ELEMENT Transaction ( URL, Option* )>
<!ATTLIST Transaction
    requestName   %nmtoken;     #REQUIRED
    a-dtype       NMTOKENS      #FIXED 'requestName NMTOKEN'
>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Transport.mod#14 $
-->

<!--
    For better definitions of these Elements/Entities, refer to the cXML
    Protocol Specification documents.
-->

<!--
    cXML envelope

    version
        Version of this cXML transmission.  Should be less than or equal
    to the version portion of the SYSTEM identifier for this document.

    payloadID
        A unique identifier for this document.

    timestamp
        The date and time at which this document was originally created.

    xml:lang
        The default locale for all strings (not formatted items such as
    dates, times and numbers) in this document.  This attribute will be
    required in a future version of cXML.  (Leaving it out is
    deprecated.)
-->
<!ELEMENT cXML (( Header, (Message | Request)) | Response)>
<!ATTLIST cXML
    version    %string;       "&cxml.version;"
    payloadID  %string;       #REQUIRED
    timestamp  %datetime.tz;  #REQUIRED
    xml:lang   %xmlLangCode;  #IMPLIED
>

<!-- header -->
<!ELEMENT Header (From, To, Sender, (Path, OriginalDocument)?)>

<!ELEMENT From (Credential+)>
<!ELEMENT To (Credential+)>
<!ELEMENT Sender (Credential+, UserAgent)>

<!--
    Path. A list of nodes that records the path taken by a user through 
    a punchout chaining scenario.
-->
<!ELEMENT Path (Node+)>

<!--
    A Node is any entity connected to a Network.
    
    type
        A node can define itself as a router node or a copy node.  Routers
    assume responsibility for the transaction.  Copy Nodes request to only
    be aware of the transaction.
    
    itemDetailsRequired
        Intermediary Nodes may want to support special operations without
    having to store specific information required to fulfill that operation.
    This attribute tells the previous node to send ItemDetail information
    when performing a PunchOutSetupRequest edit/inspect operation.
-->
<!ELEMENT Node (Credential+)>
<!ATTLIST Node
    type (copy | route) #REQUIRED
    itemDetailsRequired (yes) #IMPLIED
>


<!--
    Identifies the previous document in the situation that a router node
    forwards a message or request on to a more distant node.
    
    payloadID
        The payloadId of the original document.
-->
<!ELEMENT OriginalDocument EMPTY>
<!ATTLIST OriginalDocument
    payloadID %string; #REQUIRED
>

<!--
    A textual string representing who the UserAgent is conducting the cXML
    conversation. Analogous to UserAgent for HTTP conversations.
-->
<!ELEMENT UserAgent (#PCDATA)>

<!--
    A digital signature.  The recommended format is self-contained PK7. The
    exact signed content is not that significant but current timestamp would
    be used just as a convention.

    type
        The type of digital signature used.

    encoding
        How is the signature encoded in the XML stream.
-->
<!ELEMENT DigitalSignature ANY>
<!ATTLIST DigitalSignature
    type      %string;  "PK7 self-contained"
    encoding  %string;  "Base64"
>

<!--
    A shared secret. Typically, this is a username/password type of secret
    exchanged through a secure transport before communication takes place.
-->
<!ELEMENT SharedSecret ANY>

<!--
    Represents an identity for a credential.

    lastChangedTimestamp
       When the underlying object last changed in the originating system.
       This is used in cases where the same object (e.g. a buyer
       organization) is replicated, and kept synchronized, across two
       systems.
-->
<!ELEMENT Identity ANY>
<!ATTLIST Identity
    lastChangedTimestamp  %datetime.tz;  #IMPLIED
>

<!--
    A Credential Message Authentication Code (MAC).  This is used in
    situations where one party (the sender) must prove to another (the
    receiver) that it is authenticated by a shared secret with a third
    party trusted by both.

    The MAC should be computed by the trusted third party and
    transferred to the sender.  The MAC should be opaque to the sender
    (i.e., it should be secure and non-reversible).  The MAC should
    use as its inputs enough information to accomplish the following
    goals:

    (1) The MAC must prove to the receiver that it really originated
    with the trusted third party.  E.g., the MAC could use a shared
    secret between the receiver and the trusted third party as its
    secret key.

    (2) The MAC should be usable only by a certain sender.  E.g., the
    MAC could authenticate an identifier for the sending organization.

    (3) The MAC should prove that the sender is authorized to send on
    behalf of the From organization.  E.g., the MAC could authenticate
    an identifier for the From organization.

    (4) The MAC should limit the risk of the MAC being compromised and
    used to impersonate the sender by another party communicating with
    the receiver.  E.g., the MAC could authenticate an expiration date
    or sequence number.

    type
        An implementation-dependent identifier for the exact data
        being authenticated and the method in which it is formatted
        for authentication.  Currently the only supported value is
        "FromSenderCredentials".

    algorithm
        An implementation-dependent identifier for the exact MAC
        algorithm used on the data.  Currently the only supported
        value is "HMAC-SHA1-96".

    creationDate
        The time at which this MAC was issued.  The receiver must not
        accept the MAC before this time.

    expirationDate
        The time at which this MAC expires.  The receiver must not
        accept the MAC after this time.
-->
<!ELEMENT CredentialMac (#PCDATA)>
<!ATTLIST CredentialMac
    type           %string;      #REQUIRED
    algorithm      %string;      #REQUIRED
    creationDate   %datetime.tz; #REQUIRED
    expirationDate %datetime.tz; #REQUIRED
>

<!--
    A combination of an Identity and authentication element. If the
    authentication element is present, it strongly authenticates who/what
    someone is.  The authentication element should not be sent within Message
    documents transported via an end user's browser.  One-way communication
    must be authenticated in the transport layer.

    domain
        In what domain is this Credential represented?
    type
        Does this Credential identify a marketplace or one of its member
        companies?  A Credential without this attribute describes a member
        company or unaffiliated buying organization.
-->
<!ENTITY % cxml.authentication  "SharedSecret |
                                 DigitalSignature |
                                 CredentialMac"
>
<!ELEMENT Credential (Identity, (%cxml.authentication;)?)>
<!ATTLIST Credential
    domain  %string;      #REQUIRED
    type    (marketplace) #IMPLIED
>

<!--
    Status of a Response or Message.  If present, the element content
    describes specifics of a problem.

    code
        HTTP or cXML-specific status code.

    text
        Textual version of the status code (not specific issue).

    xml:lang
        The language in which the text attribute and element content are
    written.  This attribute will be required in a future version of
    cXML.  (Leaving it out is deprecated.)
-->
<!ELEMENT Status (#PCDATA)>
<!ATTLIST Status
    code     %uint;        #REQUIRED
    text     %string;      #REQUIRED
    xml:lang %xmlLangCode; #IMPLIED
>

<!--
    Message

    When Status not present, '<Status code="200" text="OK" />' is implied.
-->
<!ELEMENT Message (Status?, %cxml.messages;)>
<!ATTLIST Message
    deploymentMode  (production | test)  "production"
    inReplyTo       %string;  #IMPLIED
>

<!-- request -->
<!ELEMENT Request (%cxml.requests;)>
<!ATTLIST Request
    deploymentMode  (production | test)  "production"
>

<!-- response -->
<!ELEMENT Response (Status, (%cxml.responses;)?)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/modules/Contract.mod#6 $
-->

<!--
    Use of the Contract element is deprecated

    A  mechanism for sending static contract pricing information.
-->
<!ELEMENT Contract (SupplierID+, Comments?, ItemSegment+)>
<!ATTLIST Contract
    effectiveDate   %datetime.tz;  #REQUIRED
    expirationDate  %datetime.tz;  #REQUIRED
>

<!--
    Use of the ItemSegment element is deprecated.

    Defines an item segment for the index.  An item segment is an
    overlay for index items, allowing suppliers to override certain
    item attributes on a per-contract basis.

    Items may be segmented by some agreed-upon user-specific key that
    is used to determine who is eligible for these particular overlaid
    attributes (such as reduced or different prices).  Omitting the
    segmentKey indicates that the supplier wishes to set the given
    contract price system wide (for all users).

    segmentKey      - optional agreed-upon string used to segment
                      custom prices
-->
<!ELEMENT ItemSegment (ContractItem+)>
<!ATTLIST ItemSegment
    segmentKey  %string;  #IMPLIED
>

<!--
    Use of the ContractItem element is deprecated

    A particular (custom) item overlay for a index item.  The item is
    referenced by the supplierPartID.

    ItemID - ID for the part to be overlaid.
    UnitPrice - Contract price for item
    Extrinsic - Named overlay. The Extrinsic should be named with the
    item field name it is to overlay. The Extrinsic must contain a
    <value> element which supplies the replacement value for the item
    field.
    For example:
    <ContractItem>
      <ItemID>
           <SupplierPartID>123456</SupplierPartID>
      </ItemID>
      <Extrinsic name="URL">http://www.newaddress.com</Extrinsic>
    </ContractItem>
-->
<!ELEMENT ContractItem (ItemID, UnitPrice?, Extrinsic*)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Index.mod#7 $
-->

<!--
     IndexItemAdd is the element used to insert an item in an index.

     ItemID          - uniquely identifies the item
     ItemDetail      - general information about the item
     IndexItemDetail - Index specific item detail

-->
<!ELEMENT IndexItemAdd (ItemID, ItemDetail, IndexItemDetail)>
<!--
     IndexItemDelete is the element used to remove an item from the
     index.
     ItemID          - uniquely identifies the item

-->
<!ELEMENT IndexItemDelete (ItemID) >

<!--
     IndexItemPunchout is the element used to dynamically connect an
     index item to the supplier's resource for that item.

     ItemID          - uniquely identifies the item
     PunchoutDetail  - Describes the item being accessed
-->
<!ELEMENT IndexItemPunchout (ItemID, PunchoutDetail)>

<!--
     IndexItem is the general ELEMENT for the list of items in an
     index.

     IndexItemAdd      - Item(s) to be added to the index
     IndexItemDelete   - Item(s) to be removed from the index
     IndexItemPunchout - PunchOut Item(s) to be added to the index

-->
<!ELEMENT IndexItem (IndexItemAdd+ | IndexItemDelete+ | IndexItemPunchout+)>

<!--
     PunchoutDetail is the description of an item which is referenced
     in the index.

-->
<!ELEMENT PunchoutDetail (Description+, URL, Classification+,
                          ManufacturerName?, ManufacturerPartID?,
                          ExpirationDate?, EffectiveDate?,
                          SearchGroupData*, TerritoryAvailable*,
                          Extrinsic*)>

<!--
     Index is the element used to update the list of goods and/or
     services which are being handled by the system.

     SupplierID  - One or more identities by which this supplier is
                   known. NOTE: These are to be considered synonyms
                   for the same Supplier.
     SearchGroup - Description(s) of parametric search(es) for this
                   index.  Use of the SearchGroup element is
                   deprecated.
     IndexItem   - The list of items with which to modify the index

     loadmode    - The mode in which the Index is loaded, either Full
                   or Incremental.  A full index load will
                   completely replace a previously loaded index. The
                   recommended application default is incremental.
-->
<!ELEMENT Index (SupplierID+, Comments?, SearchGroup*, IndexItem+)>
<!ATTLIST Index
    loadmode (Full | Incremental) #IMPLIED
>

<!--
     Use of the SearchGroup element is deprecated.  Parametric search
     shapes should be defined using TypeDefinition and its child
     elements.

     SearchGroup is a grouping of attributes which constitute a search
     which can be performed against an index.

     Name            - Name of the search
     SearchAttribute - List of searchable index fields.
-->
<!ELEMENT SearchGroup (Name, SearchAttribute+)>

<!--
     Use of the SearchAttribute element is deprecated.  Parametric
     search shapes should be defined using TypeDefinition and its
     child elements.

     An attribute that can searched parametrically.

     name - name of the attribute.
     type - the type of the attribute
-->
<!ELEMENT SearchAttribute EMPTY>
<!ATTLIST SearchAttribute
    name  %string;  #REQUIRED
    type  %string;  #IMPLIED
>

<!--
     LeadTime specifies, in days, the amount of time required to
     receive the item.
-->
<!ELEMENT LeadTime (#PCDATA)>   <!-- uint -->

<!--
     ExpirationDate is the date and time after which the element is no longer
     valid.  Must be specified in ISO 8601 format.

-->
<!ELEMENT ExpirationDate (#PCDATA)>   <!-- datetime.tz -->
<!--
     EffectiveDate date and time at which the element becomes valid.
     Must be specified in ISO 8601 format.
-->
<!ELEMENT EffectiveDate (#PCDATA)>    <!-- datetime.tz -->

<!--
     IndexItemDetail contains various index specific elements which
     help to define an index item.
     LeadTime           - time in days to receive the item
     ExpirationDate     - Expiration date and time for the item in this index
     EffectiveDate      - Effective date and time for the item in this index
     SearchGroupData    - Parametric search data
     TerritoryAvailable - Country codes
-->
<!ELEMENT IndexItemDetail (LeadTime, ExpirationDate?, EffectiveDate?,
                           SearchGroupData*, TerritoryAvailable*)>

<!--
     Specification of a territory (using ISO country and/or region codes)
     in which the particular index item is available.
-->
<!ELEMENT TerritoryAvailable (#PCDATA)>

<!--
     SearchGroupData specifies the data which should be used to identify
     this item in a search.
-->
<!ELEMENT SearchGroupData (Name, SearchDataElement+)>

<!--
     SearchDataElement is a field and value which are used to provide the
     parametric data to a search.
-->
<!ELEMENT SearchDataElement EMPTY>
<!ATTLIST SearchDataElement
     name  %string; #REQUIRED
     value %string; #REQUIRED
>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/modules/Pending.mod#6 $
-->

<!--
    For better definitions of these Elements/Entities, refer to the cXML
    Specification documents.
-->

<!--
    A request used for polling for waiting messages. A waiting message, if
    any, will be included in the returned stream. The lastReceivedTimestamp
    attribute, if present, provides the timestamp of the last received
    message. When the Receiver sees this, it can remove messages with earlier
    timestamps from the pending queue.

    The maxMessages attribute is used to indicate the maximum number of
    pending messages that can be included in the response.


-->
<!ELEMENT GetPendingRequest (MessageType+)>
<!ATTLIST GetPendingRequest
    maxMessages            %uint;         #IMPLIED
    lastReceivedTimestamp  %datetime.tz;  #IMPLIED
>

<!--
    Indicates the type of message(s) being polled for. The valid values are
    the corresponding element names e.g. SubscriptionChangeMessage.
-->
<!ELEMENT MessageType (#PCDATA)> <!-- nmtoken -->


<!--
    The data elements being carried back in the response. These are fully
    formed cXML messages being carried through the Request/Response channel.
-->
<!ELEMENT GetPendingResponse (cXML+)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Subscription.mod#8 $
-->

<!--
    Indicates that something changed in a buyer's content subscription.
    Since this is a Message, it can come at any time - no explicit Request
    needs to be sent first.
-->
<!ELEMENT SubscriptionChangeMessage (Subscription+)>
<!ATTLIST SubscriptionChangeMessage
    type  (new | update | delete)  #REQUIRED
>

<!--
    A content subscription.
-->
<!ELEMENT Subscription (InternalID, Name, Changetime, SupplierID+, Format?,
                        Description?)>


<!ELEMENT Changetime (#PCDATA)> <!-- datetime.tz -->
<!ELEMENT Format (#PCDATA)> <!-- string -->
<!ATTLIST Format
    version  %string;  #REQUIRED
>

<!--
    Requests a complete list of catalog subscriptions for a buyer.
-->
<!ELEMENT SubscriptionListRequest EMPTY>

<!--
    The list of Subscriptions for the given buyer.
-->
<!ELEMENT SubscriptionListResponse (Subscription+)>

<!--
    Requests the contents of a catalog that the buyer is subscribed to.
-->
<!ELEMENT SubscriptionContentRequest (InternalID, SupplierID+)>

<!--
    The data associated with a particular subscription.
-->
<!ELEMENT SubscriptionContentResponse (Subscription, SubscriptionContent+)>

<!--
    The actual content associated with a particular subscription.

    Use of the Contract element is deprecated.
-->
<!ELEMENT SubscriptionContent (CIFContent | Index | Contract)>
<!ATTLIST SubscriptionContent
    filename  %string;  #IMPLIED
>

<!--
    Contents of CIF file in base64 encoding.
-->
<!ELEMENT CIFContent (#PCDATA)> <!-- bin.base64 -->

<!--
    Indicates that something has changed in the supplier data for
    a supplier the buyer has a relationship with. Since this is a message, no
    Request needs to be sent to receive this Message.
-->
<!ELEMENT SupplierChangeMessage (Supplier+)>
<!ATTLIST SupplierChangeMessage
    type  (new | update | delete)  #REQUIRED
>

<!--
    Requests for a complete list of suppliers the buyer currently has
    relationships with.
-->
<!ELEMENT SupplierListRequest EMPTY>

<!--
    The list of suppliers requested by SupplierListRequest.
-->
<!ELEMENT SupplierListResponse (Supplier+)>

<!--
    Requests for a data associated with a particular supplier identified by
    SupplierID.
-->
<!ELEMENT SupplierDataRequest (SupplierID+)>

<!--
    The data associated with the desired supplier.
-->
<!ELEMENT SupplierDataResponse (Supplier)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Provider.mod#1 $
-->

<!-- ====
    Provider* transaction is used to visually integrate an application with
    a UI provided by a service provider.
==== -->

<!--
     ProviderSetupRequest

     The originating application would provide the BrowserFormPost location
     only if it wished the provider site to display a "Done" button or
     would like information (at least Status) returned at the end of the
     interactive session.  Inclusion should lead to a ProviderDoneMessage
     from the provider at the end of a session.

     The originating application would provide the Followup location if it
     wished the provider to provide information about later status changes
     in the service (after the end of a particular Provider session).  This
     applies only when the initial status (transmitted via a
     ProviderDoneMessage) was an interim value.
-->

<!ELEMENT ProviderSetupRequest (OriginatorCookie,
                                (BrowserFormPost, Followup?)?,
                                SelectedService, Extrinsic*)>

<!--
     ProviderSetupResponse
-->

<!ELEMENT ProviderSetupResponse (StartPage)>

<!--
    ProviderDoneMessage
-->

<!ELEMENT ProviderDoneMessage (OriginatorCookie, ReturnData*)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/DataAvailable.mod#1 $
-->


<!--
    DataAvailable message.
-->

<!ELEMENT DataAvailableMessage (InternalID)>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/CatalogUpload.mod#1 $
-->

<!--
    Contain all the information related to the catalog upload, the same
    functionality as the catalog upload provided by supplier.ariba.com
-->
<!ELEMENT CatalogUploadRequest (CatalogName, Description, Attachment,
                                Commodities?, AutoPublish?, Notification)>
<!ATTLIST CatalogUploadRequest
    operation  (new | update)  #REQUIRED
>

<!--
    CatalogName is the name of the uploaded/published catalog. The
    name is unique per supplier, and it can be defined in the
    different languages
-->
<!ELEMENT CatalogName ( #PCDATA )> <!-- string -->
<!ATTLIST CatalogName
    xml:lang  %xmlLangCode;  #REQUIRED
>

<!--
    The list of the commodity codes.
-->
<!ELEMENT Commodities (CommodityCode+)>

<!--
    The two-digit code
-->
<!ELEMENT CommodityCode ( #PCDATA )> <!-- string -->

<!--
    If the attribute "enabled" set to be "true", the updated catalog
    will be published to the same buyers according to its previous
    publish
-->
<!ELEMENT AutoPublish EMPTY>
<!ATTLIST AutoPublish
    enabled       %string;       #REQUIRED
>

<!--
    The information used by Ariba CSN to send the notification (the
    status of the catalog upload) to the suppliers.
-->
<!ELEMENT Notification (Email?, URLPost?)>

<!--
    The URL to receive the StatusUpdateRequest, which describes the
    status of the catalog upload, such as the "success" (means the
    catalog is validated, or the catalog is published),
    the "failed" (the catalog has errors, ......)
-->
<!ELEMENT URLPost EMPTY>
<!ATTLIST URLPost
    enabled       %string;       #REQUIRED
>
<!--
    For cXML license agreement information, please see
    http://www.cxml.org/home/license.asp

    $Id: //ariba/cxml/Modules/Profile.mod#6 $
-->

<!--
    AuthRequest

    An AuthRequest is used when one party (the "receiver") receives
    credentials from another party (the "principal") and the receiver
    needs a trusted third party to validate the credentials.  The
    receiver should enclose the credentials in an AuthRequest and send
    them to the trusted third party for validation.

    If the principal attempts to authenticate by revealing the shared
    secret between itself and the trusted third party (not
    recommended), the receiver should forward the credentials as they
    were received, including the shared secret.

    If the principal attempts to authenticate through a client
    certificate (recommended), the receiver should forward the
    credentials as well as an X509Data element containing an
    X509IssuerSerial element describing the certificate used by the
    principal (the receiver normally obtains this information from its
    webserver or SSL/TLS implementation).

    If the supplied credential is invalid, the trusted third party
    should respond with an empty cXML response of status 403
    (Forbidden).  If the supplied credential is valid, the trusted
    third party should respond with an AuthResponse that contains the
    valid credentials.
-->
<!ELEMENT AuthRequest (Credential+, X509Data?)>

<!--
    X509Data

    An X509Data element is constructed to describe an X.509 client
    certificate being used for authentication.  This element (and its
    children) are derived from the XML Digital Signature standard ().
-->
<!ELEMENT X509Data ((X509IssuerSerial |
                     X509SKI |
                     X509SubjectName |
                     X509Certificate)+ |
                     X509CRL)>

<!--
    X509IssuerSerial

    This element is a container for the serial number and issuer name
    of the X.509 certificate.
-->
<!ELEMENT X509IssuerSerial (X509IssuerName, X509SerialNumber) >

<!--
    X509IssuerName

    This element contains the distinguished name of the issuer of the
    X.509 certificate.  The distinguished name should be a string 
    representation of an LDAP Distinguished Name, as described in RFC 
    2253.  For example,

    C=US, O="John Doe Data Security, Inc.", OU=Secure Server
    Certification Authority

-->
<!ELEMENT X509IssuerName (#PCDATA)> <!-- string -->

<!--
    X509 SubjectName

    This element contains the distinguished name of the subject of the
    X.509 certificate.  This should be a string representation of an 
    LDAP distinguished name, as described in RFC 2253.
-->
<!ELEMENT X509SubjectName (#PCDATA)> <!-- string -->

<!--
    X509SerialNumber

    This element contains the serial number of the X.509 certificate.
-->
<!ELEMENT X509SerialNumber (#PCDATA)> <!-- string -->

<!--
    X509SKI

    This element contains the Subject Key Identifier of the X.509
    certificate.
 -->
<!ELEMENT X509SKI (#PCDATA)> <!-- string -->

<!--
    X509Certificate

    This element contains a Base 64-encoded X.509v3 certificate.
-->
<!ELEMENT X509Certificate (#PCDATA)> <!-- string -->

<!--
    X509CRL

    This element contains a Base 64-encoded X.509v3 Certificate
    Revocation List.
-->
<!ELEMENT X509CRL (#PCDATA)> <!-- string -->

<!--
    AuthResponse

    This response returns a list of valid credentials of the person
    entity in the AuthRequest.  An AuthResponse is returned only for a
    successful authentication; for failed authentications, an empty
    response with status 403 (Forbidden) will be returned.

    expirationDate
        Specifies the time beyond which the information contained in
        the AuthResponse must be discarded.  In other words, the
        inclusion of the expirationDate attribute specifies that the
        receiver of the AuthResponse may cache the information therein
        until the expirationDate.

        The absence of an expirationDate should be interpreted to
        forbid caching.
-->
<!ELEMENT AuthResponse (Credential)+>
<!ATTLIST AuthResponse
    expirationDate %datetime.tz; #IMPLIED
>
