[openbiblio-dev] no name in iucr data

Thomas Krichel krichel at openlib.org
Thu Feb 3 12:53:06 UTC 2011


  Ben O'Steen writes

> Thanks for spotting this - the data is like this in the original
> unfortunately, so I wouldn't be too sure about rolling out a fix
> automatically to all the misentered 'names' (based on line endings) but
> I can get around to fixing this one at least.

  There are many others. Here is my style sheet. If you comment out
  <xsl:if test="string-length(/rdf:RDF/rdf:Description[@rdf:about=$id]/foaf:name)">
  you will see a bunch of <name/>s appear. At this time, my sheet just 
  simply ignores these authors. 

<xsl:stylesheet version="1.0"
                xmlns:xr="http://www.crossref.org/xschema/1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:dcterms="http://purl.org/dc/terms/"
                xmlns:foaf="http://xmlns.com/foaf/0.1/"
                xmlns:ov="http://open.vocab.org/terms/"
                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                exclude-result-prefixes="xr dc dcterms foaf ov rdf">
  <xsl:output method="xml"
              indent="yes" 
              omit-xml-declaration="yes"/>
  <xsl:template match="text()"/>
  <xsl:template match="/rdf:RDF">
    <amf>
      <text>
      <xsl:attribute name="id">
        <xsl:text>info:lib/iucr:</xsl:text>
        <xsl:value-of select="substring-after(/rdf:RDF/rdf:Description/dc:identifier/@rdf:resource,':')"/>
      </xsl:attribute>
      <title>
        <xsl:value-of select="/rdf:RDF/rdf:Description/dc:title"/>
      </title>
      <xsl:if test="/rdf:RDF/rdf:Description/dcterms:abstract">
        <abstract>
          <xsl:value-of select="/rdf:RDF/rdf:Description/dcterms:abstract"/>
        </abstract>
      </xsl:if>
      <displaypage>
        <xsl:value-of select="/rdf:RDF/rdf:Description/dc:link/@rdf:resource"/>
      </displaypage>
      <xsl:for-each select="/rdf:RDF/rdf:Description/dcterms:creator">
        <xsl:call-template name="creator">
          <xsl:with-param name="id">
            <xsl:value-of select="./@rdf:resource"/>            
          </xsl:with-param>
        </xsl:call-template>
      </xsl:for-each>
      </text>
    </amf>
  </xsl:template>
  <xsl:template name="creator">
    <xsl:param name="id"/>
    <xsl:if test="string-length(/rdf:RDF/rdf:Description[@rdf:about=$id]/foaf:name)">
      <hasauthor>
        <person>
          <name>
            <xsl:value-of select="/rdf:RDF/rdf:Description[@rdf:about=$id]/foaf:name"/>
          </name>
        </person>
      </hasauthor>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>


  Cheers,

  Thomas Krichel                    http://openlib.org/home/krichel
                                http://authorclaim.org/profile/pkr1
                                               skype: thomaskrichel




More information about the openbiblio-dev mailing list