Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

xsd schema for xml

xsd schema for xml

xsd schema for xml


I have existing xml schema which I need to modify to get the following data.

XSD Schema:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="sschema" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="MSG" type="MessageType"/>
<xsd:complexType name="MessageType">
<xsd:element name="TRANSACTIONS" type="TransactionsType" />
<xsd:element name="CLIENTS" type="ClientsType" />
<xsd:attribute name="MessageID" type="xsd:string" use="required"/>
<xsd:attribute name="ApplicationName" type="xsd:string" use="required"/>
<xsd:attribute name="MessageCreationTime" type="xsd:dateTime" use="required"/>
<xsd:complexType name="TransactionsType">
<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<xsd:element name="Transaction" type="TransactionType"/>
<xsd:attribute name="ChildCount" type="xsd:int" />
<xsd:complexType name="ClientsType">
<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<xsd:element name="CLIENT" type="ClientType"/>
<xsd:attribute name="ChildCount" type="xsd:int" />
<xsd:complexType name="TransactionType">
<xsd:element name="ACTION" type="ActionTypes" minOccurs="1" maxOccurs="1" />
<xsd:element name="ACCOUNTS" minOccurs="1" maxOccurs="1">
<xsd:element name="ACCOUNT" minOccurs="1" >
<xsd:element name="DEBIT_ACCOUNT" type="xsd:short" />
<xsd:element name="CREDIT_ACCOUNT" type="xsd:short" />
<xsd:element name="AMOUNT" type="xsd:string" />
<xsd:element name="ID" type="xsd:int" />

<xsd:simpleType name="ActionTypes">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Add"/>
<xsd:enumeration value="Update"/>
<xsd:enumeration value="Delete"/>

My xml for above schema for transactions looks likes this:

<TRANSACTIONS ChildCount='1'>





Now they want me to add another element in transactions element like this:

<TRANSACTIONS ChildCount='1'>









How can I add another element to 'Transactions' element because Transactions element is defined as type 'TransactionType'.

Dest_Transaction has different data structure. Both Source_transaction and Dest_transaction should be placed under 'Transactions' parent element.

Thank You

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close