[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Can XSD do "by reference"

From: Michael Kay <mike@saxonica.com>
Date: Wed, 08 Aug 2007 11:59:04 +0100
To: 'Rich Adili' <Rich.Adili@xata.com>, xmlschema-dev@w3.org
Message-id: <00a701c7d9ab$22d1d380$313410ac@turtle>
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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.