You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Scott Kurz <sc...@gmail.com> on 2007/06/27 17:49:59 UTC

example why not XSD->SDO->XSD ?

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

Re: example why not XSD->SDO->XSD ?

Posted by Scott Kurz <sc...@gmail.com>.
Fuhwei,

The fact that there are multiple XSD types which each map to String (or
Integer) is one reason, (I assume),
that you can't go XSD->SDO->XSD.

I was just reading the spec statement I mentioned and wondering if there was
something more to the problem than this... and throwing my question out
there to see if maybe there was some simple explanation someone could
provide if that were the case.

Maybe that's all I need to know though...

Thanks,
Scott







On 6/27/07, Fuhwei Lwo <fu...@bricemedia.com> wrote:
>
> 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 <sc...@gmail.com> 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
>
>

Re: example why not XSD->SDO->XSD ?

Posted by Fuhwei Lwo <fu...@bricemedia.com>.
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 <sc...@gmail.com> 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