W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2001

HELP: Need At-Least-One model, and CDATA element type

From: Brian Atkins <brian_atkins@firehunter.com>
Date: Thu, 6 Sep 2001 19:50:38 -0400 (EDT)
Message-ID: <3B980BDA.3E1F6D87@firehunter.com>
To: xmlschema-dev@w3.org
Sorry if this is already answered, but I spent several hours and couldn't find
an answer in the archives or documents.

Question 1: I want to create a model such that I can have either one or both of
a set of elements, but not none.  The following model describes my desired result:

        <xs:element name="StartTime" type="xs:dateTime"/>
        <xs:element name="StopTime" type="xs:dateTime" minOccurs="0"/>
        <xs:element name="StartTime" type="xs:dateTime" minOccurs="0"/>
        <xs:element name="StopTime" type="xs:dateTime"/>

However, this violates the "Unique Particle Attribution", according to the following
  [Error] test.xml:5:79: Error: cos-nonambig: (,StartTime) and (,StartTime) violate
  the "Unique Particle Attribution" rule.

I know this is related, even though the line number is bogus, because I can comment
out either of the sequences and the choice and it will not produce this error (but
obviously isn't what I want).

I have read about a scenario similar to what I want using substitutionGroups, but I
can't figure out how the typing would need to be for the head type and the derived
type(s).   Any suggestions or references?

Question 2:  How do I get a CDATA like type for an element?  What I want is to
encapsulate a document as payload in an element in an outer document, and have
it be completely opaque.  If the payload document happens to be HTML, XML, or anything
else, I don't care and don't want parsers or processors to touch it.  It's just a blob
of element content. For the life of me, I can't figure this out.  Any help, pointers?

Any pointers or help would be most appreciated!

Brian Atkins

Brian Atkins          brian_atkins@firehunter.com         (970) 288-2114
Agilent Technologies     4800 Wheaton Drive        Ft. Collins, CO 80525
Received on Friday, 7 September 2001 04:57:23 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC