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

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>
Re: Schema Newbie Boxed in a corner . . .

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 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.