Thanks for the response. I will attempt to construct a "simple example"
of this that illustrates the error I'm seeing. Of course in doing so
"Dare Obasanjo [MSFT]" <dareo@online.microsoft.com> wrote in message
news:%23gsnN6sREHA.3348@TK2MSFTNGP09.phx.gbl...
> The .NET Framework's XML Schema supports all aspects of XSD including
> derivation by restriction. There are probably errors in your schema.
>
> What you want to do is generally not possible with W3C XML Schema. You
> cannot create a "choice of attributes". You can define an abstract
> tableType, then define derived types fooTableType and barTableType but in
> addition should specify that the type of table is tableType in the schema
> then each instance declares whether it is a fooTableType or a barTableType
> using an xsi:type attribute.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Bill Cohagan" <bill@teraXNOSPAMXquest.com> wrote in message
> news:%2328KPagREHA.644@tk2msftngp13.phx.gbl...
> > I'd like to define a schema that allows, for example, a "table" element
> that
> > takes on one of two forms distinguished by what attributes are present.
> For
> > instance,
> >
> > <table foo="3"/>
> > <table bar="5"/>
> >
> > Note that I want to exclude <table foo="3" bar = "5"/>; i.e., using
*both*
> > attributes should fail to validate.
> >
> > A familiar example of this sort of thing is the element named
xsd:element
> in
> > XML Schema itself. It can have a type attribute or a ref attribute, but
> not
> > both. It would appear there are several ways to do this sort of thing.
One
> > approach is to define an abstract tableType, then define derived types
> > fooTableType and barTableType. We could use extension in which case the
> > derived types would provide the associated attribute. Alternatively we
> could
> > define both attributes in the base type, then derive by restriction,
> setting
> > the use of the "excluded" attribute to prohibited. Both approaches seem
to
> > work; i.e., the created XSD seems to past muster in the VS2003 IDE.
> >
> > The problem is that when I attempt to validate an XML against this XSD I
> get
> > an error complaining that the schema is not deterministic due to
multiple
> > elements named "table". Now I've read about the xsi:type attribute and
> tried
> > adding that to see if it eliminated the ambiguity, but no joy.
> >
> > I found the schema for XML Schema at
> >
http://www.w3.org/TR/xmlschema-1/#normative-schemaSchema and it uses
> > derivation by restriction to express this sort of thing. Apparently
> > Microsofts XML implementation however doesn't support this sort of
> > derivation.
> >
> > Have I missed something fundamental or is this simply not possible
within
> > the VS2003 IDE and the .Net XML implementation?
> >
> > Thanks in advance for any suggestions or pointers.
> >
> > Bill
> >
> >
>
>