W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2004

Re: dynamic enumeration definition

From: Bob Schloss <rschloss@us.ibm.com>
Date: Mon, 23 Aug 2004 18:45:58 -0400
To: xmlschema-dev@w3.org
Message-ID: <OFB06F715B.56C51565-ON85256EF9.007CB603-85256EF9.007D0EF5@us.ibm.com>





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.


Bob




                                                                           
             Christopher                                                   
             Milton                                                        
             <cmiltonperl@yaho                                          To 
             o.com>                    xmlschema-dev@w3.org                
             Sent by:                                                   cc 
             xmlschema-dev-req                                             
             uest@w3.org                                           Subject 
                                       Re: dynamic enumeration definition  
                                                                           
             08/23/2004 06:01                                              
             PM                                                            
                                                                           
                                                                           
                                                                           





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

--- Bob Schloss <rschloss@us.ibm.com> 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
a
> different field may be different.
>
> It is possible that in several years, the W3C Schema WG may permit some
of
> this in W3C XML Schema 2.0 (if such a spec is created) because many
people
> 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
To
>              rao@yahoo.com>            xmlschema-dev@w3.org

>              Sent by:
cc
>              xmlschema-dev-req

>              uest@w3.org
Subject
>                                        dynamic enumeration definition

>

>              08/23/2004 04:02

>              PM

>
> Hi All,
>
> I have a very strange problem regarding enumerations. I have 2 fields
which
> 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
{Single
> Track and Dual Carriage}
> but if field2 is associated with Bus-Taxi, field can have all of the
valid
> 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@yahoo.com
"What appears to be coming at you is coming from you."
--Jack Flanders (Meatball Fulton, ZBS)
There's an evil monkey in my closet.
Received on Monday, 23 August 2004 22:46:36 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:10 UTC