On Dec 20, 2004, at 11:16 AM, Andrew E Switala wrote:

> Actually, XML schema language can express constraints like that (a name
> authority must have only name variants with the same type attribute),
> but the technique is aesthetically...dubious.

There are a few issues here:

First, whatever the precise mechanism(s), MADS and MODS need to be more
tightly controlled.  They are now too loose.

Second, basic design decisions greatly affect how much you can control
the content, as do basic technical issues (e.g. which schema language).

Example: attributes versus elements.

I submit it's a bad idea to rely on attributes for important semantic
content (in MODS/MADS the ubiquitous "type" attribute).  It's a bad
idea because: a) it provide no flexibility to later extend (you can't
add a child to an attribute), and b) XML Schema has no support for
attribute-based validation (RELAX NG does, but that's another issue).
As a result, your ability to validate is constrained with attributes
(with XSD and DTD; not RNG).

The other issue is the larger question of the data model, which also
greatly impacts the above.

> In English, you give each descriptor an attribute with a fixed value
> that defines its equivalence class (e.g. titles and name+title
> combinations might be variants of each other, likewise geographic and
> hierarchicalGeographic, so they're in the same class). Then use keys
> and keyrefs to enforce the constraint that descriptors in different
> equivalence classes can't appear in the same MADS record.

As opposed to:

Person = element person { PersonName }
PersonName = element name { NameParts-Person }
NameParts-Person = (NamePart-Given | NamePart-Family)*
NamePart-Given = element namePart {
     attribute type { "given" },
NamePart-Family = element namePart {
     attribute type { "family" },

Alas, Trang doesn't seem to handle that well.  Not sure if that's
because of limitations in Trang or in XSD.

An element-based approach allows equivalent schemas in both languages.