RE: Attribute groups

> 
> Hi Corey,

Hi Jeni- thanks for your reply.

> > 
> What you're describing is a "co-occurrence constraint" in which the
> presence of one attribute affects whether the presence of another
> attribute is allowed.
> 
> XML Schema is notoriously bad at co-occurrence constraints. The usual
> advice in this situation would be to do one of the following:

Well, at least I'm not running into a problem that I should have been able
to resolve quickly or easily. :)

> 
>   - Express the distinct attribute combinations as separate complex
>     types both derived from the same abstract complex type; make the
>     element have the abstract type as its type; use the xsi:type
>     attribute to identify which of the two types is being used in the
>     particular instance. (Note that this involves changing the look of
>     your XML instance documents.)
> 

This is expressly what I was trying to avoid, unfortunately. I was hoping
not to have to modify the instance documents too much. However, since this
is to support a content-management system, I can probably come up with a
simple markup that I can transform to the appropriate markup so as to avoid
confusing my users with esoteric XML attributes. :)

Here's another question for you, then- is it possible, using abstract types
and/or elements, to create a "polymorphic" element? 

>   - Express as much as you can in XML Schema, then use Schematron or
>     another schema adjunct to express the co-occurrence constraint.
> 

I've been hearing a lot about Schematron, so I think I need to look into it.
I've never played with it much. I know that there's some information on it
in "Professional XML Schemas", which I have a copy of, so I'll start there.

Regards,

Corey Snow

#########################################################
The information contained in this e-mail and subsequent attachments may be privileged, 
confidential and protected from disclosure.  This transmission is intended for the sole 
use of the individual and entity to whom it is addressed.  If you are not the intended 
recipient, any dissemination, distribution or copying is strictly prohibited.  If you 
think that you have received this message in error, please e-mail the sender at the above 
e-mail address.
#########################################################

Received on Friday, 15 March 2002 14:28:36 UTC