W3C home > Mailing lists > Public > www-rdf-dspace@w3.org > June 2004

RE: Fwd: [MODS] MADS: XML schema for authorities

From: Butler, Mark <mark-h.butler@hp.com>
Date: Mon, 7 Jun 2004 16:52:14 +0100
Message-ID: <E864E95CB35C1C46B72FEA0626A2E808ED23F3@0-mail-br1.hpl.hp.com>
To: simile general <www-rdf-dspace@w3.org>

Hi Stefano

> but in the MADS schema you get
>
>   ...
>   <xsd:attribute name="relatedType" use="optional">
>   ...

> so, if the attribute is not present, the XML is legal, but the 
> stylesheet wouldn't work.

I hadn't intended the stylesheet to be complete, just to illustrate how you
could do this. If relatedType is missing, you could either make up a general
property that is a superclass of broader, narrower or other related or use a
property that has the same meaning such as skos:semanticRelation or
rdfs:seeAlso instead e.g.

<xsl:template match="ref">
     <xsl:choose>
      <xsl:when test="@relatedType">
       <xsl:element name="{@relatedType}" 
namespace="http://web.mit.edu/simile/www/2004/06/mads-custom#">
         <xsl:call-template name="refcommon"/>
       </xsl:element>
      </xsl:when>
      <xsl:otherwise>
        <rdfs:seeAlso>
         <xsl:call-template name="refcommon"/>
        </rdfs:seeAlso>
      </xsl:otherwise>
     </xsl:choose>
</xsl:template>

<xsl:template name="refcommon">
     <rdf:Description>
       <xsl:choose>
         <xsl:when test="geographic">
           <xsl:attribute 
name="rdf:about">http://web.mit.edu/simile/www/2004/06/madsdata#<xsl:value-o
f 
select="str:urlencode(geographic)"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="topic">
           <xsl:attribute 
name="rdf:about">http://web.mit.edu/simile/www/2004/06/madsdata#<xsl:value-o
f 
select="str:urlencode(topic)"/></xsl:attribute>
         </xsl:when>
       </xsl:choose>
     <xsl:apply-templates/>
     </rdf:Description>
</xsl:template>

Mark
Received on Monday, 7 June 2004 11:52:51 EDT

This archive was generated by hypermail pre-2.1.9 : Monday, 7 June 2004 11:52:52 EDT