Thank you very much both. Its really helpful.
Cheers
Arif
On Jul 1 2006, Wing Yew Poon wrote:
Arif,
Nathan is right.
If you look at the scomp script, it basically calls java on
org.apache.xmlbeans.impl.tool.SchemaCompiler with your arguments.
Look at the xmlbeans source in the svn repository.
SchemaCompiler.java is under the src/xmlcomp/ hierarchy.
SchemaCompiler has a static nested class SchemaCompiler.Parameters.
What you need to do is to create a SchemaCompiler.Parameters instance,
set its fields appropriately, and then call compile() with your
parameters.
Good luck.
- Wing Yew
-----Original Message-----
From: Nathan Sowatskey [mailto:[EMAIL PROTECTED]
Sent: Friday, June 30, 2006 3:57 AM
To: [email protected]
Subject: Re: Dynamically generating java classes from XSD file using
XmlBeans
Hi
Imagine that the CLI tool you use is really just a shell script
calling java on a java class file which has a main that takes the
arguments of the file that you want to compile, and then reads and
compiles it.
So, what you want to do is find the java class that is invoked by the
script, and replicate what its main() does.
You can also invoke the java compiler as a call to it's main, and
then use reflection to invoke your new class.
The rest is an exercise for the reader :-)
Regards
Nathan
Nathan Sowatskey - Technical Leader, NMTG CTO Engineering -
+34-638-083-675, +34-91-201-2139 - AIM NathanCisco - [EMAIL PROTECTED]
On 30 Jun 2006, at 12:46, Arif Shaon wrote:
Hi,
I am fairly new to XMLBEans. I know one can generate java classes
from xsd (XML SChema) file using scomp. But I was wondering if
there is any way it would be done on the fly. For Example, the user
would be able to specify the file path for the XSD file to the
program, and the program would then load the file, compile it,
generate the java classes and manipulate the classes as required.
Could this be done?
Any help would be greatly appreciated.
Best Regards
Arif
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Arif Shaon
Long-term Metadata Management
Computer Science
University of Reading
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]