• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSD to Table Structure(Dojo Grid)

 
Monoj Roy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21153
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
</body>

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
Greenhorn
Posts: 23
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic