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

Re: dynamic enumeration definition

From: Shashikala Shamarao <shashikala_shamarao@yahoo.com>
Date: Tue, 24 Aug 2004 07:57:37 -0700 (PDT)
Message-ID: <20040824145737.6612.qmail@web40203.mail.yahoo.com>
To: Bob Schloss <rschloss@us.ibm.com>, xmlschema-dev@w3.org
I don't understand how can a substitution group can be helpful, because field2 values are dependent on field1 values, so each of field1 values should be somehow mapped to field2 values (can be defined as enumerations for field1 values), but I don' think it is possible in XML Schema to get values for a particular value instead of name of an element.
 
These kind of restrictions are always used in any databases, so how does an XML Schema be used to represent such databases, any ideas?
 
Thanks,
Shashi

Bob Schloss <rschloss@us.ibm.com> wrote:





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 
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 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

> 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.





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Received on Tuesday, 24 August 2004 14:58:07 UTC

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