Hi Scott,

Based on the SDO 2.1 spec, if an XML Schema was originally used to define the 
SDO types, the original XSD should be used instead of generating a new XSD 
using XSDHelper.generate(List types).

This is the exception you are going to get if you invoked XSDHelper.generate() 
with types from XSD -

Exception in thread "main" java.lang.IllegalArgumentException: Cannot generate 
XSD since SDO Type 'Quote' was orginally generated from XSD.  Use original XSD
    at 
org.apache.tuscany.sdo.helper.XSDHelperImpl.generate(XSDHelperImpl.java:345)
    at 
org.apache.tuscany.sdo.helper.XSDHelperImpl.generate(XSDHelperImpl.java:289)
    at org.apache.tuscany.sdo.test.MyStaticTest2.main(MyStaticTest2.java:31)

What this means is you can only invoke XSDHelper.generate(List types) when 
those types were defined using SDO DataObject. If you can take a look at the 
test case, DefineTypeTestCase.java, as an example of how to define types using 
data object.

I believe as long as you can define types using SDO DataObject, you should be 
able to generate its XSD string. If not, please report it a bug.

Fuhwei

Scott Kurz <[EMAIL PROTECTED]> wrote: Hi,

What's the simplest example of why you can't round trip from XSD to
generated SDO back to XSD?   (or just a simple example).

The spec says:

     This is because there is more information in an XSD than in Type and
Property, primarily focused on defining the XML document syntax.


Any example will do.....

Thank you,
Scott

Reply via email to