Print

Print


Hi Kevin,

Thank you for your comments and patch.

The file has been revised and uploaded here: <http://www.loc.gov/standards/mods/v3/MODS3-5_DC_XSLT1-0.xsl>.

Tracy

Tracy Meehleib
Network Development and MARC Standards Office
Library of Congress
101 Independence Ave SE
Mail Stop 4402
Washington, DC 20540-4402
+1 202 707 0121 (voice)
+1 202 707 0115 (fax)
[log in to unmask]<mailto:[log in to unmask]>


From: Metadata Object Description Schema List [mailto:[log in to unmask]] On Behalf Of Kevin S. Clarke
Sent: Tuesday, July 22, 2014 4:27 PM
To: [log in to unmask]
Subject: Re: [MODS] MODS to DC XSLT (MODS3-5_DC_XSLT1-0.xsl) patch

Hi Kevin,

For instance, with this input:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://www.loc.gov/standards/mods/v3/MODS3-5_DC_XSLT1-0.xsl"?>
<modsCollection xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.loc.gov/mods/v3"
  xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-5.xsd">
  <mods version="3.5">
    <titleInfo>
      <title>Sample record</title>
    </titleInfo>
    <subject>
      <geographic>Alaska</geographic>
    </subject>
  </mods>
</modsCollection>

The output is:

<?xml version="1.0"?>
<srw_dc:dcCollection xmlns:srw_dc="info:srw/schema/1/dc-schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/standards/sru/resources/dc-schema.xsd">
  <srw_dc:dc xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/standards/sru/resources/dc-schema.xsd">
    <dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">Sample record</dc:title>
    <dc:subject xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"/>
    <dc:coverage xmlns:dc="http://purl.org/dc/elements/1.1/">Alaska</dc:coverage>
  </srw_dc:dc>
</srw_dc:dcCollection>

This includes an empty dc:subject in addition to the dc:coverage which is generated from the subject/geographic.

Kevin



On Tue, Jul 22, 2014 at 2:52 PM, Ford, Kevin <[log in to unmask]<mailto:[log in to unmask]>> wrote:
Thanks, Kevin.

Could we also see the MODS record you are transforming.  I'm trying to picture the issue and I think that would help.

Yours,
Kevin

--
Kevin Ford
Network Development and MARC Standards Office
Library of Congress
Washington, DC



> -----Original Message-----
> From: Metadata Object Description Schema List
> [mailto:[log in to unmask]<mailto:[log in to unmask]>] On Behalf Of Kevin S. Clarke
> Sent: Tuesday, July 22, 2014 2:20 PM
> To: [log in to unmask]<mailto:[log in to unmask]>
> Subject: [MODS] MODS to DC XSLT (MODS3-5_DC_XSLT1-0.xsl) patch
>
> Hi,
>
> I'm not sure if this is the right place to report this, but I believe I've found
> something in the MODS to DC XSLT (MODS3-5_DC_XSLT1-
> 0.xsl) that could be fixed.
>
> We were getting empty dc:subject elements in our XML from the following
> template:
>
> <xsl:template match="mods:subject[mods:topic | mods:name |
> mods:occupation | mods:geographic | mods:hierarchicalGeographic |
> mods:cartographics | mods:temporal] ">
>   <dc:subject>
>     <xsl:for-each select="mods:topic | mods:occupation">
>       <xsl:value-of select="."/>
>       <xsl:if test="position()!=last()">--</xsl:if>
>     </xsl:for-each>
>     <xsl:for-each select="mods:name">
>       <xsl:call-template name="name"/>
>     </xsl:for-each>
>   </dc:subject>
>
> This was from MODS records that had mods:geographic elements, for
> instance, but no mods:topic, mods:occupation, or mods:name elements.
> My solution was to wrap the dc:subject that is generated for mods:topic or
> mods:occupation elements, and mods:name elements, in an xsl:test to make
> sure one of those exists before outputting the dc:subject element:
>
> <xsl:if test="mods:topic | mods:occupation | mods:name">
>   <dc:subject>
>     <xsl:for-each select="mods:topic | mods:occupation">
>       <xsl:value-of select="."/>
>       <xsl:if test="position()!=last()">--</xsl:if>
>     </xsl:for-each>
>     <xsl:for-each select="mods:name">
>       <xsl:call-template name="name"/>
>     </xsl:for-each>
>   </dc:subject>
> </xsl:if>
>
> I've attached a patch as well (which may more clearly illustrate the change).
> If there is some place else (a GitHub repository, for
> instance) to which I should report this, please let me know.
>
> Thanks,
> Kevin



--
"There are two kinds of people in this world: those who believe there are two kinds of people in this world and those who know better."