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

Re: how far should you go with XML schema?

  • From: "Jean Marc VANEL" <jean-marc_vanel@e...>
  • To: xml-dev@x..., "David Valera" <dvalera@p...>, jmvanel@f...
  • Date: Tue, 30 May 2000 11:53:53 +0200

xsd condition


We had a nice conference on XML-QL from someone from W3C at WWW9 conference ; they , among other goals, want to combine XML schema and XSLT, but for purposes of query. It is a spec. in progress.

About your data, I would do this, using natural containment semantics. From a linguistic point of vue, it can be questionned to use a <wedding/> tag alone to indicate married status, but it avoids
need for "if" construct in Schema.
Also this design, using natural containment and tags from natural language like "wedding" and "date", is extendible.
You can add later inside wedding, without breaking code, other tags such as <location>, <witness>, <contract>, etc.

<xsd:element name="myroot">
 <xsd:complexType content="elementOnly">
  <xsd:element name="wedding">
   <xsd:complexType>
    <xsd:element name="date" type="xsd:date" minOccurs="0" />
   </xsd:complexType>
  </xsd:element>
 </xsd:complexType>
</xsd:element>





From: "David Valera" <dvalera@p...> on 30/05/2000 09:53 AM

To:   xml-dev@x...
cc:    (bcc: Jean Marc VANEL/EFFIX/fr)

Subject:  how far should you go with XML schema?


hello,

Since I started the development of an XML schema for the XML documents I
will need to validate, I have been asking myself:

What are the limitations of XML schema if you compare them with RDMS
constraints?

I ask this because in the XML messages I have there are a few conditions
that cannot be expressed in XML schema. Just to ilustrate take the following
example:

<myroot>
     <married>yes</married>
     <dateofwedding>1973-10-12</dateofwedding>
</myroot>

I would love to have the possibility of having something like this in XML
schema: (look at the condition attributes in the dateofwedding element)

<xsd:element name="myroot">
 <xsd:complexType content="elementOnly">
  <xsd:element name="married">
   <xsd:simpleType base="xsd:string">
     <xsd:enumeration value="yes"/>
     <xsd:enumeration value="no"/>
   </xsd:simpleType>
  </xsd:element>
  <xsd:element name="dateofwedding"
    type="xsd:date" condition="if married=yes" then="minOccurs="0""
else="minOccurs="1"")/>
 </xsd:complexType>
</xsd:element>

"if married=yes" should of course be an xsl statement, but I hope you get
the point.

Is this a desirable development in XML schema? Will something like this be
implemented in future versions of XML schema? are there other XML drafts
that combine XML schema and lets say XSL do this kind of condition checking
during validation?

Thanks in advance for any thoughts on this...

David Valera


***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************







***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.