Hi Werner , Yes I have to access the underlying complex type definition. I am not able to find any particular function which returns the defination so that I can traverse through its child nodes.
Could you please tell me which function to use. Regards Anupam Das -----Original Message----- From: Werner Guttmann [mailto:[email protected]] Sent: Friday, November 27, 2009 3:29 AM To: [email protected] Subject: Re: [castor-user] After generating Schema ..... Hi, [email protected] wrote: > Hi All, > > I am new to Castor ........ > > I am able to create schema with > Schema schema = xi2s.createSchema(inputSource); and after writing it > in a file it gives me : > <?xml version="1.0" encoding="UTF-8"?> <schema > xmlns="http://www.w3.org/2001/XMLSchema > <http://www.w3.org/2001/XMLSchema> " > xmlns:xsd="http://www.w3.org/2001/XMLSchema > <http://www.w3.org/2001/XMLSchema> "> > <element name="profile"> > <complexType> > <sequence> > <element name="name" type="string"/> > <element name="lastname" type="string"/> > <element name="leavetype" type="string"/> > <element name="leavesavail" type="integer"/> > <element name="totalleaves" type="integer"/> > </sequence> > </complexType> > </element> > </schema> > > I want to get the list of elements under <profile> tag , that is name > , lastname , leavetype...... > I tried with : > for (Enumeration e = schema.getElementDecls(); e.hasMoreElements();) > {} Well, Schema.getElementDecls() returns the top level element(s) of your XML schema, in your case <profile> only. You will have to access the underlying complex type definition and its sub-elements. > > but only able to access the top element ... > > HOW can i traverse through all the elements ? > > Thanks in advance . > > Regards > Anupam Das Cheers Werner > > > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

