Hello ,

I am new to xml and unable to debug the issue .

In my xml I have the below complex type defined

<xs:complexType name="charge-percentage">
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="type" use="required" type="charge-percentage-type"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

Below this is defined

<xs:simpleType name="charge-percentage-type">
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
<xs:enumeration value="AgentCommission"/>
<xs:enumeration value="AgentCommissionWaiver"/>
<xs:enumeration value="Discount"/>
<xs:enumeration value="InitialCharge"/>
<xs:enumeration value="RedemptionCharge"/>
<xs:enumeration value="DilutionLevy"/>
<xs:enumeration value="DilutionLevyNAVPercent"/>
</xs:restriction>
</xs:simpleType>

I ma getting the below error :

SimpleType (/STPBulkDeal:charge-percentage-type) for attribute: type not found.

Is it beacuse simpletype is defined below complex type ?

Below is the complete xsd

<xs:element name="STPBulkDeal">
<xs:annotation>
<xs:documentation>
The STPBulk Deal Message is a message sent from an external system
electronically to request the placing of multiple deals on Rufus GTA.

The message will be delivered to the Bravura Solutions Babel product
which in turn will validate the message content, if valid Babel will split the
message into a parent lifecycle per portfolio and a child lifecycle per deal.
Babel will then attempt to place the individual deals on Rufus GTA. Any deals
that fail to book will be routed to Babel User Intervention.

The STPBulkDeal supports the following transaction types on Rufus GTA:

1) Create Buy / Sell / Switch Deal

The message can contain 1 to Many investors (Use existing investors only)
The message can contain 1 to Many Portfolios under each Investor (Use existing portfolios only)
The message can contain 1 to Many Fund Transactions under each portfolio (single transaction type
per portfolio)

The Fund Transaction may be:
A subscription into a single Rufus fund with alias if required
A redemption from a single Rufus fund with alias if required
A one-to-one switch from one fund to another within the same portfolio

Settlement can be specified for subscriptions and redemptions (switches
will default to Internal Settlement) but STPBulkDeal does not support the
Uninvested Cash Model supported in STPApplication
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="rufus-instance" type="xs:string">
<xs:annotation>
<xs:documentation>
Mutually agreed identifier for the target Rufus database
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="sender-id" type="xs:string">
<xs:annotation>
<xs:documentation>
Mutually agreed identifier for the sender of the message
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="application-date" type="xs:dateTime">
<xs:annotation>
<xs:documentation>
The application date field is a required field that can be used to specify the date
time the message was created by the external system. Babel will translate the application
date to the trade date for any deals specified within the message that do not
have a transaction-level application-date specified.

If a time zone is not provided Babel will assume the Babel Server time zone.

Format is YYYY-MM-DDThh:mm:ss(+/-)HH:MM (the time zone is optional) Valid Examples are:
2001-05-30T10:05:00
2001-05-30T10:05:00Z (Indicating UTC)
2001-05-30T10:05:00+01:00 (Indicating the time is 1 hour ahead of UTC)

If not passed, for any transctions that do not have a transaction-level application-date
Babel will use the message received date time as the transaction date time.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="application-id" type="xs:string">
<xs:annotation>
<xs:documentation>
The application id is a mandatory unique identifier for the instruction
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="unbounded" name="investor" type="investor">
<xs:annotation>
<xs:documentation>
Mandatory Investor Details.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="investor">
<xs:annotation>
<xs:documentation>
Details of investor to be dealt against.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="investor-reference" type="reference">
<xs:annotation>
<xs:documentation>
The investor-reference identifies the investor to be used for later processing.
A reftypeid of '-1' indicates the Rufus Investor Code. Only a single reference
can be supplied per investor.

It is possible to identify the investor by a portfolio external reference only,
in which case the investor reference will not be populated.

For investor external references the external system needs to
know the Rufus RefTypeID for the corresponding external reference type.

Example Investor External References already supported:

RefTypeID Description
-1 Rufus Client Code
1 SWIFT BIC Code
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="unbounded" name="portfolio" type="portfolio">
<xs:annotation>
<xs:documentation>
Mandatory Portfolio Details.
All deals are below it.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="portfolio">
<xs:annotation>
<xs:documentation>
Details of portfolio to be dealt against.
All deals are below it.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="portfolio-reference" type="reference">
<xs:annotation>
<xs:documentation>
The portfolio-reference identifies the portfolio to be used in dealing.
A reftypid of '-1'indicates the Rufus Portfolio Number

For portfolio external references the external system needs to
know the Rufus RefTypeID for the corresponding external reference type.

Example Portfolio External Reference Types already supported:

RefTypeID Description
-1 Rufus Portfolio Number
1 P2P SWIFT Account ID
2 Vestima Distributor ID
3 FundSettle Distributor ID
16 Swift Net Account ID
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="unbounded" name="fund-transaction" type="fund-transaction">
<xs:annotation>
<xs:documentation>
Details of any fund transactions.
Multiple fund transactions can be supplied per portfolio
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="fund-transaction">
<xs:annotation>
<xs:documentation>
The fund-transaction element is used to specify an investment
into, a withdrawal from, or a switch between funds for the portfolio.

Multiple fund-transactions can be specified per portfolio, per message

Only one to one switches are supported which must be a switch-out
and a switch-in linked together using a unique link-reference
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="link-reference" type="xs:int">
<xs:annotation>
<xs:documentation>
Provides the link between legs of a switch. Only one to one
switches are supported which must be a switch-out and a
switch-in linked together using a unique link-reference within the message.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" name="deal-reference" type="reference">
<xs:annotation>
<xs:documentation>
The deal-reference allows specification of an external reference
to assciate to the deal. A reftypid of '-1' indicates the Rufus
Deal Reference and should not be used as Rufus allocates
the deal reference once the deal is struck

For deal external references the external system needs to know
the Rufus RefTypeID for the corresponding external reference type.

Example Deal External Reference Types currently supported:
RefTypeID Description
1 SWIFT Message ID
10 EMX Deal ID
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="temporary-trade-indicator" type="xs:boolean">
<xs:annotation>
<xs:documentation>
Used by Babel to mark this trade as a temporary (predicted) trade which
is intended for later cancellation through a scheduled task.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="application-date" type="xs:dateTime">
<xs:annotation>
<xs:documentation>
The application date field at the transaction level can be used to specify the date
time the trade was created by the external system. Babel will translate the application
date to the trade date for any deals specified within the message.

If a time zone is not provided Babel will assume the Babel Server time zone.

Format is YYYY-MM-DDThh:mm:ss(+/-)HH:MM (the time zone is optional) Valid Examples are:
2001-05-30T10:05:00
2001-05-30T10:05:00Z (Indicating UTC)
2001-05-30T10:05:00+01:00 (Indicating the time is 1 hour ahead of UTC)

If not passed Babel will use the file level application-date field,
or if that is not specified the message received date time, as the transaction date time.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="use-servicing-agent" type="xs:boolean">
<xs:annotation>
<xs:documentation>
Should the portfolio servicing agent for the derived portfolio
be attached to the deal as the transaction agent meaning agent
level terms of business are applied. If not supplied babel
will default to 'True'
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="1" maxOccurs="1" name="type-direction">
<xs:annotation>
<xs:documentation>
The type-direction indicates the deal direction
'Buy' = investment
'Sell' = withdrawal
'Switch-out' = switch out
'Switch-in' = switch in
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Buy" />
<xs:enumeration value="Sell" />
<xs:enumeration value="Switch-out" />
<xs:enumeration value="Switch-in" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="alias" type="xs:string">
<xs:annotation>
<xs:documentation>
Textual alias for the deal. This will be used by Babel to
look up the corresponding Rufus GTA alias code.

An alias is attached deal to override the default transaction
type name
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:choice>
<xs:element minOccurs="0" maxOccurs="1" name="amount" type="currency-amount">
<xs:annotation>
<xs:documentation>
The gross amount to be invested / withdrawn
Rufus terminology is Cost to Holder / Due to Holder
Applicable to:
'Buy' = investment
'Sell' = withdrawal
'Switch-out' = switch out
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="units" type="xs:decimal">
<xs:annotation>
<xs:documentation>
The number of units to be bought / sold
Applicable to:
'Buy' = investment
'Sell' = withdrawal
'Switch-out' = switch out
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="percent" type="xs:decimal">
<xs:annotation>
<xs:documentation>
The percentage of the deal.. Only applicable to 'sell' or 'switch-out'
the user indicates that want to withdraw a percentage of
there holding. 100.00 = 100%

switch-in deals will always be 100 percent of proceeds so the field
is not required, if passed for switch-in deals it will be ignored
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
<xs:element minOccurs="1" maxOccurs="1" name="asset" type="reference">
<xs:annotation>
<xs:documentation>
The asset to be invested into / withdrawn from.
A reftypid of '-1' indicates the Rufus Fund Code

For asset external references the external system needs to
know the Rufus RefTypeID for the corresponding external
reference type.

Example Asset External Reference Types currently supported:
RefTypeID Description
-1 Rufus Fund Code
1 ISIN code
2 CUSIP (US)
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="unit-type">
<xs:annotation>
<xs:documentation>
The unit type is required where the asset identifier
resolves to an asset that supports both distribution
and accumulation units
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Distribution" />
<xs:enumeration value="Accumulation" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="settlement">
<xs:annotation>
<xs:documentation>
The method of settlement for the fund-transaction. Settlement
is optional and if not set a user will have to manually
settle the deal later
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element minOccurs="1" maxOccurs="1" name="buy-settlement" type="buy-settlement" />
<xs:element minOccurs="1" maxOccurs="1" name="sell-settlement" type="sell-settlement" />
</xs:choice>
<xs:element minOccurs="0" maxOccurs="1" name="contractual-settlement-delay" type="xs:int">
<xs:annotation>
<xs:documentation>
Contractual Settlement Delay Override.
Number of days to be used to derive contractual settlement date
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="settlement-currency-code" type="xs:string">
<xs:annotation>
<xs:documentation>
ISO currency code for settlement. If supplied Babel will instruct
Rufus to Settle in this currency and if required perform FX
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" name="deal-terms-override">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element minOccurs="0" maxOccurs="1" name="percent" type="charge-percentage">
<xs:annotation>
<xs:documentation>
Override percentage expressed as a decimal (100 = 100%)
Attribute Type, valid values:
* AgentCommission
* AgentCommissionWaiver
* Discount
* InitialCharge
* RedemptionCharge
* DilutionLevy
* DilutionLevyNAVPercent
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="amount" type="charge-amount">
<xs:annotation>
<xs:documentation>
Override amount expressed as a decimal (100 = 100.00)
Attribute Type, valid values:
* FlatRateCharge
* CDSC (can only be overridden to zero)
* Witholding Tax (can only be overridden to zero)
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="contact-method-alias" type="xs:int">
<xs:annotation>
<xs:documentation>
The contact method (Deal Source) which is an Id available on Rufus GTA
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>

<!-- Complex Type Definition for "reference" -->

<xs:complexType name="reference">
<xs:sequence>
<xs:element default="-1" name="ref-typeid" type="xs:int">
<xs:annotation>
<xs:documentation>
Either Investor / Portfolio / Asset level references to be used
to identify the entity. See investor-reference, portfolio-reference,
asset-reference

-1 indicates rufus code is passed in the value.

Also used if specifying Deal References to be attached to
the deal. See deal-reference for the supported ref-type-ids
for each entity
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ref-value" type="xs:string" />
</xs:sequence>
</xs:complexType>

<!-- Complex Type Definition for "currency-amount" -->

<xs:complexType name="currency-amount">
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="currency-code" type="xs:string">
<xs:annotation>
<xs:documentation>
ISO currency code and amount, if the currency is not
passed the asset currency will be assumed
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>



<xs:complexType name="charge-amount">
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="type" use="required" type="charge-amount-type"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:simpleType name="charge-amount-type">
<xs:restriction base="xs:string">
<xs:maxLength value="1"/>
<xs:enumeration value="FlatRateCharge"/>
<xs:enumeration value="CDSCAmount"/>
<xs:enumeration value="WithholdingTax"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="charge-percentage">
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="type" use="required" type="charge-percentage-type"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:simpleType name="charge-percentage-type">
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
<xs:enumeration value="AgentCommission"/>
<xs:enumeration value="AgentCommissionWaiver"/>
<xs:enumeration value="Discount"/>
<xs:enumeration value="InitialCharge"/>
<xs:enumeration value="RedemptionCharge"/>
<xs:enumeration value="DilutionLevy"/>
<xs:enumeration value="DilutionLevyNAVPercent"/>
</xs:restriction>
</xs:simpleType>

<!-- Complex Type Definition for "buy-settlement" -->

<xs:complexType name="buy-settlement">
<xs:annotation>
<xs:documentation>
Only supports client specific non-cash management settlement
method codes.

switch-in should not have a settle-method defined and will
auto settle using internal transfer
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="settle-method" type="xs:string">
<xs:annotation>
<xs:documentation>
A pre-agreed Rufus settlement method code
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="settle-net" type="xs:boolean">
<xs:annotation>
<xs:documentation>
Should the deal be settled net or gross of commission. if 'True' settle net
else if 'False', or not passed, settle gross
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>

<!-- Complex Type Definition for "sell-settlement" -->

<xs:complexType name="sell-settlement">
<xs:annotation>
<xs:documentation>
Only supports pre-defined payment methods.

True switch-out should not have a settle-method defined and will
auto settle using internal transfer

The following methods are supported:
BACS - Deal will settle via BACS, message must also supply a mandate
level to use.
Outside-Rufus = Deal will "settle" in Rufus without generating any Rufus
GTA payments i.e. message is settled off system
Coverall = If specified Rufus GTA will attempt to use a
portfolio level coverall
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="payment-method">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="BACS" />
<xs:enumeration value="Outside-Rufus" />
<xs:enumeration value="Coverall" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="settlement-mandate-level">
<xs:annotation>
<xs:documentation>
Where payment-method is BACS the investor or portfolio must
have a mandate.
This element defines whether the investor or portfolio level
mandate should be used.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Investor" />
<xs:enumeration value="Portfolio" />
<xs:enumeration value="Portfolio-Redemption" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="mandate-number" type="xs:int" >
<xs:annotation>
<xs:documentation>
For a portfolio-redemption mandate it is possible to hold
multiple mandates for the same currency. In this scenario
the external system needs to pass the seqence number
associated to the mandate

Mandatory when selecting a portfolio redemption Mandate
for use in settlement
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>