Page 1 of 1

XML Schema for 2 Dimensional Table

Posted: Thu Feb 07, 2008 5:59 pm
by dbaechtel
I am using Oxygen 8.2 to develop a Schema for a Database. I have come across a need to describe a Two Dimensional Table with an unbounded number of Rows and Columns and Cells for each Row and Column combination. I know how to use xs:sequence to describe a 1 dimensional list. But what is the best way to describe a 2 dimensional table with NxM cells in an XML Schema?

Any Help is greatly appreciated.
:?

Re: XML Schema for 2 Dimensional Table

Posted: Thu Feb 07, 2008 6:23 pm
by sorin_ristache
Hello,

You can define a row of the table as a sequence of maximum maxColumnNumber cells. You have to replace maxRowNumber and maxColumnNumber with real numbers.

Code: Select all

<xs:element name="table">
<xs:complexType>
<xs:sequence maxOccurs="maxRowNumber">
<xs:element name="row">
<xs:complexType>
<xs:sequence maxOccurs="maxColumnNumber">
<xs:element ref="tableCellType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Regards,
Sorin

Re: XML Schema for 2 Dimensional Table

Posted: Thu Feb 07, 2008 6:37 pm
by dbaechtel
Thanks! :)