osdir.com
mailing list archive

Subject: Writing out a schema out of an interface - msg#00022

List: text.xml.xmlbeans.user

Date: Prev Next Index Thread: Prev Next Index
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


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

CDATA Heuristics

Hi, in our library we are very interested using XMLBeans in a document archiving project which stores XML files in a database. The excellent round-tripping characteristics of XMLBeans are crucial in our project. But, with the serialization of text containing escaped '<'-s and '&'-s we're at a loss. XMLBeans seems to have some heuristics to decide when text containing these characters should be saved as CDATA and when not. Is it possible to decide at runtime when text should be saved in CDATA sections and when not? Or better, can in some way CDATA sections be preserved? Best regards, Patrick

Next Message by Date: click to view message preview

Re: Writing out a schema out of an interface

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 <jayachandra@xxxxxxxxx> 05/06/2005 03:22 PM Please respond to user@xxxxxxxxxxxxxxxxxxx To user@xxxxxxxxxxxxxxxxxxx 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@xxxxxxxxxxxxxxxxxxx For additional commands, e-mail: user-help@xxxxxxxxxxxxxxxxxxx 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

Previous Message by Thread: click to view message preview

CDATA Heuristics

Hi, in our library we are very interested using XMLBeans in a document archiving project which stores XML files in a database. The excellent round-tripping characteristics of XMLBeans are crucial in our project. But, with the serialization of text containing escaped '<'-s and '&'-s we're at a loss. XMLBeans seems to have some heuristics to decide when text containing these characters should be saved as CDATA and when not. Is it possible to decide at runtime when text should be saved in CDATA sections and when not? Or better, can in some way CDATA sections be preserved? Best regards, Patrick

Next Message by Thread: click to view message preview

Re: Writing out a schema out of an interface

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 <jayachandra@xxxxxxxxx> 05/06/2005 03:22 PM Please respond to user@xxxxxxxxxxxxxxxxxxx To user@xxxxxxxxxxxxxxxxxxx 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@xxxxxxxxxxxxxxxxxxx For additional commands, e-mail: user-help@xxxxxxxxxxxxxxxxxxx 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
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by