W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2008

Re: Schema Newbie Boxed in a corner . . .

From: <noah_mendelsohn@us.ibm.com>
Date: Mon, 28 Apr 2008 11:39:00 -0400
To: "Andrew Welch" <andrew.j.welch@gmail.com>
Cc: "Frank Merrow" <fmerrow@qualcomm.com>, "Michael Kay" <mike@saxonica.com>, xmlschema-dev@w3.org
Message-ID: <OF5D4870CF.75C95400-ON85257439.0055442D-85257439.0055BFEB@lotus.com>

As Mike and others have told you, the markup you're using is not in a 
style that most XML users would consider idiomatic or best practice (I 
think that's fair to say.)  If you really want to use XSD, and if you know 
at any given point in time what the set of legal element names is, it's 
possible that you could write a program, perhaps in the form of an XSL 
stylesheet, to dynamically generate XSD documents that would validate the 
particular set of elements that are current.  It appears from your example 
that multiple such elements may share structural constraints.  If so, it 
may be possible to define a set of XSD complex types, one for each form 
(e.g. for all the wiki elements.)  Then your dynamic XSD generator might 
output schemas along the lines of:

<xsd:sequence> <!-- or repeated choice if you prefer -->
  <xsd:element name="AI00020000" type='faq'/>
  <xsd:element name="AI00020001" type='wiki'/>
  <xsd:element name="AI00020002" type='wiki'/>
</xsd:sequence>

Presuming of course that the complex types "faq" and "wiki" have been 
suitably defined.

Noah

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------
Received on Monday, 28 April 2008 15:38:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:46 UTC