Women in Technology

Hear us Roar



Article:
  XML Data Binding with Castor
Subject:   How to bind all low-level elements in one top level class
Date:   2005-05-04 21:34:42
From:   vijaypriya
HI Castor Users,


<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">


<xsd:element name="employee">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="header" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="age" type="xsd:integer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="body" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="serviceId" type="xsd:integer" />
<xsd:element name="salary" type="xsd:integer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>


</xsd:schema>



using the source Generator , it will create employee, header, body classes and get/set methods with respect.


But i wanted only one class employee, and all the attribute elements(name ,age,serviceid,salary) should be in the employee class with get/set methods.
Is there any way to get the above .or please suggest me any other way to write the binding file for the requirement.
Please Send me a copy of your answer to this Email
thanks in advance


Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • How to bind all low-level elements in one top level class
    2005-11-07 00:29:22  Ramdevaki [View]

    Hi,
    This is ram.I have the problem with using the source Generator.

    Please Send me a copy of your answer to this Email
    thanks in advance