Login  Register

Re: XSD schema conversion anyone?

Posted by Iain Fogg on Aug 08, 2006; 7:21am
URL: http://ofbiz.116.s1.nabble.com/XSD-schema-conversion-anyone-tp170452p170470.html

I might be missing something here....

XML Schema defines the structure of data, albeit in a heirarchical data
model.
Unless I've completely missed the mark, the OFBiz data model is
relational; certainly the entitydefs looks pretty relational to me
(tables, fields, pks, fks, cardinality contraints, and so on) - not to
mention the underlying implementation.

Generally, there is nothing in a hierarchical data model that can't be
implemented in a relational one. So assuming XML Schema has no nasty
features, then there is no reason you couldn't apply a mapping from one
to the other. At least, that's in theory :-)

I've have just stumbled across a tool that might do precisely what I
want - I'll report back if it works, in case anyone else is interested.
If it works, it'll generate the SQL DDL to create the tables - going
from there to OFBiz ought to be a doddle.

Thanks for the feedback.

Cheers, Iain

BJ Freeman wrote:

> what chris said is correct.
> The onix DTD or XSD describes how the actual data is formated in the
> XML. it is not the data.
> there is no way to automatically translate the onix DTD to ofbiz
> entities. this has to be done by hand.
> One way, if this is going to be a daily import, is to write a import
> routine.  One routine reads the onix data using the onix DTD and puts
> in a map that is then used to put the map data into ofbiz.
> Another way is to read the XML using Dom then write out xml format for
> ofbiz entities and use the webtools services to import into ofbiz.
>
>
>
>
> Iain Fogg sent the following on 8/7/2006 5:51 PM:
>
>> Chris,
>>
>> Good question, and this probably exposes my ignorance of XST. Maybe
>> it's not the right technology. Maybe I need to find a tool that can
>> translate from XSD -> SQL. Then it would be straightforward to map
>> the relational table defs to the OFBiz entity def. My small brain
>> can't get round the mapping of the hierarchical XML Schema to a
>> relational one - at least not given it's size. Maybe when I was
>> younger :-)
>>
>> In case anyone is interested, the schema I want to map is the ONIX
>> schema (used in the book trade).
>>
>> Cheers, Iain
>>
>> Chris Howe wrote:
>>
>>> Correct me if I'm wrong, but wouldn't you need to know
>>> what the source elements are in order to make an XST
>>> to entity def?  Absent knowing the structure of your
>>> source it wouldn't matter what someone else's XST
>>> looks like, it wouldn't work with yours.
>>>
>>> --- Iain Fogg <[hidden email]> wrote:
>>>
>>>  
>>>
>>>> That's my question...has anyone already buit an XST
>>>> to do the conversion to OFBiz Entity defs?
>>>>
>>>> BJ Freeman wrote:
>>>>
>>>>  
>>>>
>>>>> the XSD defines the layout.
>>>>> the XML is where the Entities definitions are.
>>>>> you can try using an XST file to convert.
>>>>>
>>>>> Iain Fogg sent the following on 8/7/2006 7:53 AM:
>>>>>
>>>>>    
>>>>>
>>>>>> I have a slightly complicated XML Schema (.xsd)
>>>>>>      
>>>>>
>>>> that I would like to  
>>>>
>>>>>> import into OFBiz.
>>>>>>
>>>>>> Has anyone written a tool to convert XML schemas
>>>>>>      
>>>>>
>>>> into OFBiz  entity  
>>>>
>>>>>> definitions?
>>>>>>
>>>>>> Cheers, Iain
>>>>>>
>>>>>>
>>>>>>      
>>>>>
>>>>>    
>>>>
>>>>
>>>> --
>>>> No virus found in this outgoing message.
>>>> Checked by AVG Free Edition.
>>>> Version: 7.1.405 / Virus Database: 268.10.7/411 -
>>>> Release Date: 7/08/2006
>>>>
>>>>
>>>>  
>>>
>>>
>>>
>>>
>>>  
>>>
>>
>>
>>
>
>



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 7/08/2006