Sorry; just a followup in case anyone is interested. Here's how it'd
work in RNG:
Say you have this that defines the identifier element currently:
mods-identifier = element identifier {
attribute type { text }?,
attribute displayLabel { text }?,
attribute invalid { xsd:string "yes" }?,
attlist-language,
xsd:string
}
This says you can have anything for an identifier, so long as the
element value is a string.
With RNG, you can do something like this:
identifier = ( ISBN | ISSN )
ISBN = element identifier {
attribute type { "isbn" }?,
attribute displayLabel { text }?,
attribute invalid { xsd:string "yes" }?,
xsd:string
}
ISSN = element identifier {
attribute type { "issn" }?,
attribute displayLabel { text }?,
attribute invalid { xsd:string "yes" }?,
xsd:positiveInteger
}
This is much more precise, then. It says, "you may choose from this
list of type values; if you choose ISBN, the element content must
conform to a string, while an ISSN must be a positive integer."
I imagine you'd want rather customized pattern definitions, though,
which would be much more complex. Still, the attribute-level control
of RNG is a really nice thing.
Bruce
|