You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by jayachandra <ja...@gmail.com> on 2005/05/06 11:52:09 UTC

Writing out a schema out of an interface

Hi ppl,
I am new to XMLBeans. Did my homework of getting started, testing
certain scripts. Creating interfaces out of XMLSchema and projecting a
java friendly programming flexibility to manipulate the placeholders
etc. is great in XMLBeans. But can the reverse functionality be also
done using XMLBeans. I mean, given a class can I get a schema
generated for it. For example

Input:
-------
public class MyComplexType {
  String name;
  int  value;
}

Output:
-----------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
  targetNamespace="http://DefaultNamespace"
  xmlns:tns="http://DefaultNamespace"
  elementFormDefault="qualified">
  <xs:complexType name="MyComplexType">
      <sequence>
          <xs:element name="name" type="xsd:string"/>
          <xs:element name="value" type="xsd:integer"/>
      </sequence>
  </xs:complexType>
</xs:schema>

Can XMLBeans be employed to accomplish this, if not do any of you know
of some tool that can do this? Your help will be very much
appreciated.

Thanks
Jayachandra
-- 
-- Jaya

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Writing out a schema out of an interface

Posted by su...@tcs.com.
Hi,
XMLBean will not help you in the reverse process that is to create a XML 
out of a JAVA object. Instead, what I suggest, is that  use any DOM /SAX 
parser to create a XML document out of the java object. I have written one 
utility class which takes one transferObject and creates a xml out of this 
transferObject. 

Keep in touch if you need any more help.

Best Reagards,
Sujoy Banerjee




jayachandra <ja...@gmail.com> 
05/06/2005 03:22 PM
Please respond to
user@xmlbeans.apache.org


To
user@xmlbeans.apache.org
cc

Subject
Writing out a schema out of an interface






Hi ppl,
I am new to XMLBeans. Did my homework of getting started, testing
certain scripts. Creating interfaces out of XMLSchema and projecting a
java friendly programming flexibility to manipulate the placeholders
etc. is great in XMLBeans. But can the reverse functionality be also
done using XMLBeans. I mean, given a class can I get a schema
generated for it. For example

Input:
-------
public class MyComplexType {
  String name;
  int  value;
}

Output:
-----------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
  targetNamespace="http://DefaultNamespace"
  xmlns:tns="http://DefaultNamespace"
  elementFormDefault="qualified">
  <xs:complexType name="MyComplexType">
      <sequence>
          <xs:element name="name" type="xsd:string"/>
          <xs:element name="value" type="xsd:integer"/>
      </sequence>
  </xs:complexType>
</xs:schema>

Can XMLBeans be employed to accomplish this, if not do any of you know
of some tool that can do this? Your help will be very much
appreciated.

Thanks
Jayachandra
-- 
-- Jaya

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


ForwardSourceID:NT0000B602 


Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information.   If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited.   If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments.  Thank you