Changeset 870

Show
Ignore:
Timestamp:
08/02/07 10:26:17 (1 year ago)
Author:
thomase
Message:

Chunk output into first-letter-of-id alphabetic bins. Add origin and rights statement to XML files.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • BibIt/trunk/ProcModsCollection.xsl

    r869 r870  
    2525          ================================================================ --> 
    2626    <xsl:param name="mapnum">999</xsl:param> 
    27     <xsl:param name="outpath">/monkeypox/</xsl:param> 
     27    <xsl:param name="outpath">/badigit/deathstar/</xsl:param> 
     28    <xsl:param name="outchunk">yes</xsl:param> 
     29    <xsl:param name="htmlout"></xsl:param> 
     30    <xsl:param name="modsout">mods/</xsl:param> 
     31    <xsl:param name="citout">citations/</xsl:param> 
     32     
     33     
    2834     
    2935    <!-- ================================================================  
     
    4955     
    5056    <xsl:template match="/"> 
    51         <xsl:result-document href="{$outpath}batl{$mapnum}.html" format="toc-format" > 
     57        <xsl:result-document href="{$outpath}{$htmlout}batl{$mapnum}.html" format="toc-format" > 
    5258            <html xmlns="http://www.w3.org/1999/xhtml"> 
    5359                <head> 
     
    7581        <xsl:variable name="newid"><xsl:call-template name="makenewid"/></xsl:variable> 
    7682        <xsl:variable name="thetitle"><xsl:call-template name="getbesttitle"/></xsl:variable> 
     83        <xsl:variable name="thisoutpath"><xsl:value-of select="$outpath"/><xsl:if test="string-length($outchunk) != 0 and $outchunk != 'no'"><xsl:value-of select="substring($newid, 1, 1)"/>/</xsl:if></xsl:variable> 
     84        <xsl:variable name="thisouturl"><xsl:if test="string-length($outchunk) != 0 and $outchunk != 'no'"><xsl:value-of select="substring($newid, 1, 1)"/>/</xsl:if></xsl:variable> 
    7785        <xsl:element name="li"> 
    7886            <xsl:attribute name="id"><xsl:value-of select="$newid"/></xsl:attribute> 
     
    8189                    <xsl:element name="a"> 
    8290                        <xsl:attribute name="class">abbreviatedtitle</xsl:attribute> 
    83                         <xsl:attribute name="href"><xsl:value-of select="$newid"/>.html</xsl:attribute> 
     91                        <xsl:attribute name="href"><xsl:value-of select="$thisouturl"/><xsl:value-of select="$newid"/>.html</xsl:attribute> 
    8492                        <xsl:if test="mods:titleInfo[@type='abbreviated' and @xml:lang]"><xsl:copy-of select="mods:titleInfo[@type='abbreviated']/@xml:lang"/></xsl:if> 
    8593                        <xsl:if test="mods:titleInfo[@type='uniform']"> 
     
    9199                    <xsl:element name="a"> 
    92100                        <xsl:attribute name="class">uniformtitle</xsl:attribute> 
    93                         <xsl:attribute name="href"><xsl:value-of select="$newid"/>.html</xsl:attribute> 
     101                        <xsl:attribute name="href"><xsl:value-of select="$thisouturl"/><xsl:value-of select="$newid"/>.html</xsl:attribute> 
    94102                        <xsl:if test="mods:titleInfo[@type='uniform' and @xml:lang]"><xsl:copy-of select="mods:titleInfo[@type='uniform']/@xml:lang"/></xsl:if> 
    95103                        <xsl:value-of select="mods:titleInfo[@type='uniform'][1]/mods:title"/></xsl:element> 
     
    102110        </xsl:element> 
    103111 
    104         <xsl:result-document href="{$outpath}{$newid}.xml" format="mods-format"> 
     112 
     113        <xsl:result-document href="{$thisoutpath}{$modsout}{$newid}.xml" format="mods-format"> 
    105114            <!-- create the separate mods xml file --> 
    106115            <xsl:apply-templates select="." mode="copy"/> 
    107116        </xsl:result-document> 
    108117         
    109         <xsl:result-document href="{$outpath}citations/{$newid}.xml" 
     118        <xsl:result-document href="{$thisoutpath}{$citout}{$newid}.xml" 
    110119            format="citation-format"> 
    111120            <!-- create separate file to hold formatted citation --> 
     
    119128 
    120129         
    121         <xsl:result-document href="{$outpath}{$newid}.html" format="record-format" > 
     130        <xsl:result-document href="{$thisoutpath}{$htmlout}{$newid}.html" format="record-format" > 
    122131            <!-- create a separate html file --> 
    123132            <html xmlns="http://www.w3.org/1999/xhtml"> 
     
    145154                        <h2>Alternate formats:</h2> 
    146155                        <xsl:apply-templates select="." mode="coins"/> 
    147                         <p id="modsxml">MODS XML file: <a href="{$newid}.xml"><xsl:value-of select="$newid"/>.xml</a></p> 
     156                        <xsl:variable name="modsrelurl"><xsl:for-each select="tokenize($htmlout, '/')">../</xsl:for-each><xsl:if test="$outchunk != '' and $outchunk != 'no'">../</xsl:if></xsl:variable> 
     157                        <p id="modsxml">MODS XML file: <a href="{$modsrelurl}{$thisouturl}{$modsout}{$newid}.xml"><xsl:value-of select="$newid"/>.xml</a></p> 
    148158                    </div> 
    149159                    <div id="searchforit"> 
     
    160170                        at least 3 different online library catalog systems. Where possible, information from publishers' and authors' websites has  
    161171                        also been consulted.</p> 
    162                          
     172 
     173                        <xsl:variable name="rightsrelurl"><xsl:for-each select="tokenize($htmlout, '/')">../</xsl:for-each><xsl:if test="$outchunk != '' and $outchunk != 'no'">../</xsl:if></xsl:variable> 
     174 
    163175                        <p>We encourage you, in accordance with standard scholarly practice, to cite the source of this data if you copy and  
    164176                        redistribute it en masse. Use of individual citations in articles, papers and books need not be cited, but you should  
    165                         check them yourself for accuracy. <a href="rights.html">This  
     177                        check them yourself for accuracy. <a href="{$rightsrelurl}rights.html">This  
    166178                            data is in  
    167179                        the public domain</a>.</p> 
     
    197209        <xsl:copy> 
    198210            <xsl:apply-templates select="@*" mode="copy"/> 
     211<xsl:text> 
     212     
     213</xsl:text><xsl:comment>About this information: 
     214 
     215This bibliographic record was compiled by staff and affiliates of the Ancient  
     216World Mapping Center (http://www.unc.edu/awmc/) and its Pleiades Project  
     217(http://pleiades.stoa.org). The information in it was compiled initially from  
     218citation handlists and other unpublished working papers of the Classical Atlas  
     219Project (1988-2000). It was subsequently verified, updated and expanded with  
     220reference to an actual copy of the work cited, or (failing that) to at least 3  
     221different online library catalog systems. Where possible, information from  
     222publishers' and authors' websites has also been consulted. 
     223 
     224We encourage you, in accordance with standard scholarly practice, to cite the  
     225source of this data if you copy and redistribute it en masse. Use of individual  
     226citations in articles, papers and books need not be cited, but you should check  
     227them yourself for accuracy. 
     228             
     229<xsl:variable name="docpath">file://<xsl:value-of select="$outpath"/>rights.html</xsl:variable> 
     230<xsl:for-each select="doc($docpath)"><xsl:for-each select="./descendant::html:body/html:p"> 
     231<xsl:value-of select="."/><xsl:text> 
     232     
     233</xsl:text> 
     234</xsl:for-each></xsl:for-each>             
     235             
     236            </xsl:comment> 
    199237            <xsl:apply-templates mode="copy"/> 
    200238            <xsl:element name="mods:identifier"> 
     
    351389     
    352390    <xsl:template match="mods:titleInfo" mode="details"> 
    353         <li><xsl:value-of select="@type"/> title: <xsl:apply-templates select="mods:title" mode="details"/></li> 
     391        <li><xsl:choose> 
     392            <xsl:when test="@type = 'uniform'">full title: </xsl:when> 
     393            <xsl:when test="@type = 'abbreviated'">short title: </xsl:when> 
     394            <xsl:otherwise>alternate title: </xsl:otherwise> 
     395        </xsl:choose><xsl:apply-templates select="mods:title" mode="details"/></li> 
    354396        <xsl:if test="@xml:lang"><li>title language (xml:lang): <xsl:value-of select=" @xml:lang"/></li></xsl:if> 
    355397    </xsl:template> 
     
    401443            <xsl:variable name="parenttitle"><xsl:for-each select="$parent"><xsl:call-template name="getbesttitle"/></xsl:for-each></xsl:variable> 
    402444            <xsl:variable name="parentnewid"><xsl:for-each select="$parent"><xsl:call-template name="makenewid"/></xsl:for-each></xsl:variable> 
     445            <xsl:variable name="parentrelurl"><xsl:for-each select="tokenize($htmlout, '/')">../</xsl:for-each><xsl:if test="$outchunk != '' and $outchunk != 'no'">../</xsl:if></xsl:variable> 
     446            <xsl:variable name="parentouturl"><xsl:value-of select="$parentrelurl"/><xsl:if test="string-length($outchunk) != 0 and $outchunk != 'no'"><xsl:value-of select="substring($parentnewid, 1, 1)"/>/</xsl:if></xsl:variable> 
    403447            <xsl:choose> 
    404448                <xsl:when test="$childgenre='volume' and mods:part/mods:detail[@type='volume']">this work is volume <xsl:value-of select="mods:part/mods:detail[@type='volume']"/> of:  
     
    410454                <xsl:when test="$parentgenre = 'journal'">appears in journal issue:  
    411455                    <xsl:element name="a"> 
    412                         <xsl:attribute name="href"><xsl:value-of select="$parentnewid"/>.html</xsl:attribute> 
     456                        <xsl:attribute name="href"><xsl:value-of select="$parentouturl"/><xsl:value-of select="$htmlout"/><xsl:value-of select="$parentnewid"/>.html</xsl:attribute> 
    413457                        <xsl:attribute name="title"><xsl:value-of select="$parent/mods:titleInfo[@type='uniform']/mods:title"/></xsl:attribute> 
    414458                        <xsl:value-of select="$parenttitle"/></xsl:element> 
     
    419463                <xsl:when test="$parentgenre='series'">series: 
    420464                    <xsl:element name="a"> 
    421                         <xsl:attribute name="href"><xsl:value-of select="$parentnewid"/>.html</xsl:attribute> 
     465                        <xsl:attribute name="href"><xsl:value-of select="$parentouturl"/><xsl:value-of select="$htmlout"/><xsl:value-of select="$parentnewid"/>.html</xsl:attribute> 
    422466                        <xsl:attribute name="title"><xsl:value-of select="$parent/mods:titleInfo[@type='uniform']/mods:title"/></xsl:attribute> 
    423467                        <xsl:value-of select="$parenttitle"/></xsl:element> 
     
    427471                <xsl:when test="$parentgenre='collection'">appears in the collection: 
    428472                    <xsl:element name="a"> 
    429                         <xsl:attribute name="href"><xsl:value-of select="$parentnewid"/>.html</xsl:attribute> 
     473                        <xsl:attribute name="href"><xsl:value-of select="$parentouturl"/><xsl:value-of select="$htmlout"/><xsl:value-of select="$parentnewid"/>.html</xsl:attribute> 
    430474                        <xsl:attribute name="title"><xsl:value-of select="$parent/mods:titleInfo[@type='uniform']/mods:title"/></xsl:attribute> 
    431475                        <xsl:value-of select="$parenttitle"/></xsl:element>