Also, if you are curious about schema type compilation, I wrote some test code that got contributed a couple of years ago. It lives under test/src/compile/ ... Best of luck, -Jacobd
On 3/17/07, Jacob Danner <[EMAIL PROTECTED]> wrote:
Hi Siddharth, A couple of things. First, this functionality (generating an instance from a schema) is already available in XMLBeans. If you look int he bin directory there is even a cmd/sh script for it where you pass in the name of the type you want to generate an instance for, etc. That might save you some time. Second, I think the reason you are getting this error is because you are compiling a string vs a file. I think (I do not know for certain) that xmlbeans uses the value of org.apache.xmlbeans.XmlDocumentProperties.getSourceName() to resolve the URI. When you build from a Schema from a string this value is null. In this case, the error you are receiving appears to be correct. I like to think of URI resolution as if it were a URL or file path. As in, How would I refer to this file if I were accessing it via the web. In the code you attached how do you give a URI to this other java string? ie, how would you navigate to it via your filesystem or the web. I'm curious why you don't just add the String product schema to the schemaArray that you use to compile, or reference both schemas from the file system . Hope this helps, -Jacobd On 3/17/07, Siddharth Ranjan Patnaik <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > My aim is to get an instance XML from a schema. > > When the schema contains an import it gives following problem.(Though I have > a EntityResolver) > > > > org.apache.xmlbeans.XmlException: error: URL "prod.xsd" is > not well-formed > > at > org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) > > at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown > Source) > > at java.lang.reflect.Method.invoke(Unknown Source) > > at > org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) > > at > org.apache.xmlbeans.XmlBeans.compileXsd(XmlBeans.java:553) > > at > com.Schema2Instance.printSchema2Instance(Schema2Instance.java:75) > > at com.Schema2Instance.main(Schema2Instance.java:30) > > > > > > What I feel is , though my entity resolver is able to resolve the imported > schema and correctly returns , still it tries to make a URL object for the > schema location and subsiquently it fails. > > > > I am attahing the test program which u can simply run and the error will get > printed to console. > > > > Please help me.Its yrgent for me. > > > > Regards, > > Siddharth > > *********************************************************************** > > The information in this message is confidential and may be legally > > privileged. It is intended solely for the addressee. Access to this > > message by anyone else is unauthorized. If you are not the > > intended recipient, any disclosure, copying, or distribution of the > > message, or any action or omission taken by you in reliance on > > it is prohibited and may be unlawful. Please immediately contact > > the sender if you have received this message in error. This email > > does not constitute any commitment from Cordys Holding BV or > > any of its subsidiaries except when expressly agreed in a written > > agreement between the intended recipient and > > Cordys Holding BV or its subsidiaries. > > *********************************************************************** > > > > > > > --------------------------------------------------------------------- > 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]

