RE: Can XSD do "by reference"

Your requirements would be a lot clearer if you gave a sample of the
instance XML.

It sounds to me as if you are trying to do something like

<row>
  <column name="x" value="3"/>
  <column name="y" value="fred"/>
</row> 
<row>
  <column name="x" value="5"/>
  <column name="y" value="bill"/>
</row>

That really does't lend itself at all well to writing an XSD schema, which
assumes that you can work out the intended type of an element or attribute
from knowledge of its name and its containing type.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Rich Adili
> Sent: 08 August 2007 05:40
> To: xmlschema-dev@w3.org
> Subject: Can XSD do "by reference"
> 
> 
> I would like to define a sort of row-column schema. Although 
> the XML is easy to write manually, I'm having trouble finding 
> an elegant schema design. The requirements are:
> 
> 1. A sequence (1 or more occurrences) of column definitions, 
> which is straightforward enough i.e. a sequence of elements 
> each with a sequence of identical children. This would permit 
> one to create column types by adding an entry to this list of 
> properties that a column must have. A simplistic example: 
> columns must have properties Name and Type. One instance 
> might have Name="Purchase Type" and Type="string". Another 
> instance might have Name="Purchase Date" and Type="Date".
> 
> 2. Another sequence that provides row data using references 
> to each of the above types rather than a copy 
> (Name(1)="Capital Equipment" AND Name(2)="1/1/2007");
> 
> I can be quite flexible as to the particulars as long as it 
> will pass through the Visual Studio code generator(XSD.exe) 
> and provide the above properties. However, I haven't found a 
> way to do the reference bit in #2. Visual Studio's DataSet 
> designer provides an implementation of this using data 
> relations but it's rather complex. Is a simpler solution feasible?
> 
> Rich
> 

Received on Wednesday, 8 August 2007 10:59:19 UTC