Andrew, thanks. I see what you did, which is that elements aren't
contained within other elements, which makes good sense from a logic
point of view. So again I ask: is there a reason NOT to use elements
only? Would it seem odd to folks who are accustomed to XML? Is it more
difficult to define in a schema? I'm trying to understand why there
might be resistance to this method given that we have identified at
least two advantages (easier translation to RDF, and ability to encode
items with spaces in leading & training positions, plus multiple spaces).
kc
Houghton,Andrew wrote:
>>From: Metadata Object Description Schema List
>>[mailto:[log in to unmask]] On Behalf Of Karen Coyle
>>Sent: 22 July, 2005 13:24
>>To: [log in to unmask]
>>Subject: [MODS] Getting rid of attributes?
>>
>>.. would it be enough to make author and type sub-elements of
>>the topic elements, i.e.
>>
>> <mads xsi:schemaLocation="http://www.loc.gov/mads/mads.xsd">
>> <authority>
>> <topic>Computer programming
>> <authorityList>lcsh</authorityList>
>> </topic>
>> </authority>
>> <related>
>> <topic>Computers
>> <relatedType>broader</relatedType>
>> <authorityList>lcsh</authorityList>
>> </topic>
>> </related>
>>etc.
>>
>>And if that's all it would take, what is the downside of
>>using this style? Are there particular advantages to using
>>attributes vs. elements?
>>
>>
>
>What you have proposed is what is called a Mixed Model where you
>mix text and elements freely, like you do in HTML. I wouldn't
>recommend using a Mixed Model for any XML based grammar. However,
>you can turn any Mixed Model into regular model by the declaration
>of a few more elements. So your example might become:
>
><mads xsi:schemaLocation="http://www.loc.gov/mads/mads.xsd">
> <authority>
> <topic>
> <label>Computer programming</label>
> <authorityList>lcsh</authorityList>
> </topic>
> </authority>
> <related>
> <topic>
> <label>Computers</label>
> <relatedType>broader</relatedType>
> <authorityList>lcsh</authorityList>
> </topic>
> </related>
></mads>
>
>There is an upside to using element only based XML grammars in that
>you can put your XML grammar into RDF by using the striping method.
>So given my altered example, you could just wrap that XML with
><rdf:RDF xmlns:rdf="..."> ... </rdf:RDF> thus <mads> becomes an RDF
>class.
>
>There is one issue with using attributes that you need to be aware of.
>Attribute values are normalized according to the XML specification,
>thus leading, trailing and multiple embedded spaces are collapsed and
>attribute values are not affected by xml:space attribute.
>
>
>Andy.
>
>
>
>
--
-----------------------------------
Karen Coyle / Digital Library Consultant
[log in to unmask] http://www.kcoyle.net
ph.: 510-540-7596
fx.: 510-848-3913
mo.: 510-435-8234
------------------------------------
|