Altova Mailing List Archives

Re: dynamic enumeration definition

From: Bob Schloss <rschloss@--.---.--->
To: xmlschema-dev@--.---
Date: 8/23/2004 2:46:00 PM

If creators of instance documents are willing to signal, in elements
occuring in advance of the two fields, which sets of validation rules
should apply,
either by changing the element name (as Christopher suggests, substitution
groups work well here), or by using xsi:type or equivalent,
on an ancestor element, they can do this.

I (possibly incorrectly) assumed the question was if the preceding ancestor
elements to the two fields give no information about what the value of the
first field was, how can the schema validator be instructed to do this.  As
I understand it, it cannot under that restriction.


             <cmiltonperl@yaho                                          To 
   >                    xmlschema-dev@w...                
             Sent by:                                                   cc 
             uest@w...                                           Subject 
                                       Re: dynamic enumeration definition  
             08/23/2004 06:01                                              

What about using a substitution group with each member receiving
a different pair of enumerations?

--- Bob Schloss <rschloss@u...> wrote:
> W3C XML Schema 1.0 does not permit you to say this.
> You are asking for one case of what are known as "co-occurence
> constraints": depending upon one field's value, the permitted values for
> different field may be different.
> It is possible that in several years, the W3C Schema WG may permit some
> this in W3C XML Schema 2.0 (if such a spec is created) because many
> ask about this.
> For now, you'd have to supplement XML Schema Validation with another
> system, based on technologies like XSLT, in order to enforce your
> constraint.
> Good Luck,
> Bob Schloss
> Scalable XML Infrastructure
> IBM Thomas J Watson Research Center
> Yorktown Heights, New York, USA

>              Shashikala

>              Shamarao

>              <shashikala_shama
>              rao@y...>            xmlschema-dev@w...

>              Sent by:
>              xmlschema-dev-req

>              uest@w...
>                                        dynamic enumeration definition


>              08/23/2004 04:02

>              PM

> Hi All,
> I have a very strange problem regarding enumerations. I have 2 fields
> have enumeration values associated with them. But the problem is based on
> first field's value, the second fields enumeration changes,
> for example let us say I have 2 fields like below with their overall
> enumerations
> field1 - road - {Pedestrain, Cycle Way, Bus-Taxi}
> field2 - carriage - {Single Carriage, Dual Carriage, Single track}
> if field1 is associated with a value of Cycle field2 can have only
> Track and Dual Carriage}
> but if field2 is associated with Bus-Taxi, field can have all of the
> values.
> How do I represent such filtered enumerations using XML Schema?
> Any help would be appreciated.
> Thanks,
> Shashi
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.

Christopher Milton  <==||==> cmiltonperl@y...
"What appears to be coming at you is coming from you."
--Jack Flanders (Meatball Fulton, ZBS)
There's an evil monkey in my closet.

From frakilk@y... Tue Aug 24 00:26:16 2004
Received: from ([])
	by with esmtp (Exim 4.34)
	id 1BzP8i-0007IP-5B
	for xmlschema-d


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.