File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XSD to Table Structure(Dojo Grid) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSD to Table Structure(Dojo Grid)" Watch "XSD to Table Structure(Dojo Grid)" New topic

XSD to Table Structure(Dojo Grid)

Monoj Roy
Ranch Hand

Joined: Oct 10, 2007
Posts: 98
I want to write a Java component to populate a table(Dojo grid) from a XML which will valid through a XML Schema (The XSD file ).That means I am having the .xsd file and have to create a table structure corresponding to the XML structure (That is .xsd file ).

Can anybody help me on giving some idea how to convert a .xsd file to its corresponding table structure .
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

I don't think a schema has a corresponding table structure. But if the schemas you are working with do happen to have such a thing, then your first step would be to describe the mapping between the schema and the table.

As far as I can see from googling, this Dojo grid is some kind of a GUI component. So I expect it has a design phase and a data model. You'd have to have something to convert your schema to a Dojo grid design and something else to convert your data to a Dojo grid data model. That's all just speculation, though.

Presumably you're already pretty good at designing and implementing Dojo grids? If not, then you need to get there before you can think about generating them automatically.
Monoj Roy
Ranch Hand

Joined: Oct 10, 2007
Posts: 98
Thanks for your interest in my post .

For dojo in most cases there will be a view per table .
A view is a collection of rows. As We all know that a table is a collection of rows and that a row has several columns. However, in a grid, a row may have many subrows and each subrow can have a different number of columns.

Product Title (Subrow 1, Column 1) Price (Subrow 1, Column 2) Type (Subrow 1, Column 3)

Description (Subrow 2, Column 1, Colspan 3)

Here is the code :

var subrow1 = [{name: "Product Title"}, {name: "Price"}, {name: "Type"}];
var subrow2 = [{name: "Product Title"}]
var view = {rows: [ subrow1 ,subrow2]};

var structure = [ view ];

and we can drar the table with following HTML code

<body class="tundra">
<div dojoType="dojox.Grid" autoWidth="true" structure="structure"></div>

So thats how dojo grid works .
Now please can you help me how to map a XSD
or what will be the approach to genarate automatically the structure from the XSD..?
Laxmikant Ruikar

Joined: Nov 29, 2005
Posts: 23
This link may help you
I agree. Here's the link:
subject: XSD to Table Structure(Dojo Grid)
It's not a secret anymore!