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

Re: Identifying absent behavior

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 7 Nov 2001 15:50:53 +0000
Message-ID: <6017952123.20011107155053@jenitennison.com>
To: "Garrett Steed" <gmsteed@seasllc.com>
CC: xmlschema-dev@w3.org
nillable t
Hi Garrett,

> I would like to specifically disallow this:
> Absent c element: <t><t> <t/>
> When parsing a document there must be a string with in the <t/> tags.

It's still a little unclear, I'm afraid. I think you're saying that
you want to say that the t element must contain a c element. If so,
you can do that in XML Schema with:

<xs:element name="t">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="c" />
    </xs:sequence>
  </xs:complexType>
</xs:element>

The following would both be valid (assuming that the c element
declaration means that the c element can have empty content and is
nillable):

  <t><c /></t>
  <t><c xsi:nil="yes" /></t>

Whereas the following would be invalid:

  <t></t>
  <t />
  <t><d /></t>
  <t><c /><c /></t>

If you want to allow the c element to repeat, you should use the
maxOccurs attribute.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Wednesday, 7 November 2001 10:50:56 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.