Changeset 953

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

finish refactoring - html generation now works

Files:

Legend:

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

    r944 r953  
    1010    <xsl:import href="modsdetails.xsl"/> 
    1111    <xsl:import href="modscoins.xsl"/> 
     12    <xsl:import href="searchforit.xsl"/> 
    1213     
    1314    <xsl:param name="htmloutpath">/badigit/scratch2/</xsl:param> 
    1415    <xsl:param name="rightspath">/TomDocs/awmcwork/pleiadesact/svnbox/pleiades-bibliography/rights.html</xsl:param> 
    15  
    16     <xsl:output name="html-format" method="html" indent="yes" escape-uri-attributes="yes" 
     16    <xsl:param name="langspath">/TomDocs/awmcwork/pleiadesact/svnbox/BibIt/language-subtags.xml</xsl:param> 
     17    <xsl:variable name="langs" select="doc($langspath)/child::*[1]"/> 
     18    <!-- <xsl:output name="html-format" method="html" indent="yes" escape-uri-attributes="yes" 
    1719        encoding="UTF-8" 
    1820        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" 
    19         doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" /> 
    20  
     21        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" /> --> 
     22    <!-- MSIE can't handle reality --> 
     23<xsl:output name="html-format" method="xhtml" indent="yes" escape-uri-attributes="yes" 
     24        encoding="UTF-8" include-content-type="yes" omit-xml-declaration="yes" /> 
    2125    <xsl:template match="/"> 
    2226        <xsl:apply-templates /> 
     
    2529    <xsl:template match="mods:mods"> 
    2630        <xsl:variable name="thetitle"><xsl:call-template name="getbesttitle"/></xsl:variable> 
     31        <xsl:variable name="thedate" select="descendant::mods:recordChangeDate[last()]"/> 
    2732        <xsl:result-document href="{$htmloutpath}{@ID}.html" format="html-format"> 
    28             <html xmlns="http://www.w3.org/1999/xhtml"
     33            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
    2934                <head> 
    3035                    <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> 
     36                    <xsl:element name="meta"> 
     37                        <xsl:attribute name="http-equiv">last-modified</xsl:attribute> 
     38                        <xsl:attribute name="content"><xsl:value-of select="normalize-space($thedate)"/></xsl:attribute> 
     39                    </xsl:element> 
     40                    <style type="text/css" media="screen"> @import "recordstyle.css"; </style> 
    3141                    <title><xsl:value-of select="normalize-space($thetitle)" /></title> 
    3242                </head> 
    3343                <body> 
    34                     <h1><xsl:value-of select="normalize-space($thetitle)" /></h1> 
    35                     <p>Last revised: <xsl:call-template name="now2text" /></p> 
     44                    <div id="navigation"> 
     45                        <a href="index.html">awmc bibliography</a>: <xsl:value-of select="@ID"/>  
     46                        >> <a href="#details">details</a> 
     47                        | <a href="{@ID}.xml">mods xml</a> 
     48                        | <a href="#searchforit">find this work</a> 
     49                        | <a href="#meta">about</a> 
     50                    </div> 
     51                    <div id="content"> 
     52                        <h1><xsl:value-of select="normalize-space($thetitle)" /></h1> 
     53                    <p>Last revised: <xsl:value-of select="$thedate"/></p> 
    3654                    <div id="formattedcitation"> 
    3755                        <h2>Formatted citation:</h2> 
    38                         <ul> 
    39                             <li></li> 
    40                         </ul> 
     56                                <p><xsl:copy-of select="mods:extension/html:div[@class='formatted-citation']/*"/></p> 
    4157                    </div> 
    4258                    <div id="details"> 
     
    5773                    <div id="meta"> 
    5874                        <h2>About this information:</h2> 
    59                         <p>This bibliographic record was compiled by staff and affiliates 
    60                             of the <a href="http://www.unc.edu/awmc/">Ancient World 
    61                                 Mapping Center</a> and its <a 
    62                                 href="http://pleiades.stoa.org">Pleiades Project</a>. The 
    63                             information in it was compiled initially from citation 
    64                             handlists and other unpublished working papers of the <a 
    65                                 href="http://www.unc.edu/depts/cl_atlas/">Classical Atlas 
    66                                 Project</a> (1988-2000). It was subsequently verified, 
    67                             updated and expanded with reference to an actual copy of the 
    68                             work cited, or (failing that) to at least 3 different online 
    69                             library catalog systems. Where possible, information from 
    70                             publishers' and authors' websites has also been consulted. 
    71                             Relationships between works, reflected by links in the "full 
    72                             details" sections of individual records, have been 
    73                             programmatically calculated on the basis of textual 
    74                             information in the original records. You should check 
    75                             individual citations for accuracy before using them.</p> 
    76  
     75                        <xsl:for-each select="descendant::mods:recordContentSource[1]"> 
     76                             <p>This record originated at <xsl:value-of select="normalize-space(.)"/>.</p> 
     77                        </xsl:for-each> 
     78                        <xsl:for-each select="descendant::mods:recordCreationDate[1]"> 
     79                             <p>Date of record creation: <xsl:value-of select="normalize-space(.)"/>.</p> 
     80                        </xsl:for-each> 
     81                        <p>Subsequent changes occurred on:</p> 
     82                        <ul> 
     83                        <xsl:for-each select="descendant::mods:recordChangeDate"> 
     84                             <li><xsl:value-of select="normalize-space(.)"/></li> 
     85                        </xsl:for-each> 
     86                        </ul> 
     87                        <xsl:for-each select="descendant::mods:recordOrigin[1]"> 
     88                            <p><xsl:value-of select="normalize-space(.)"/></p> 
     89                        </xsl:for-each> 
     90                        <p>Accuracy is not guaranteed. Details of citations should be independently checked before  
     91                        use or incorporation in another work.</p> 
    7792                        <xsl:for-each select="doc($rightspath)"> 
    7893                            <xsl:copy-of select="./descendant::html:body/html:p" /> 
    7994                        </xsl:for-each> 
    8095 
    81                     </div> 
     96                    </div></div> 
    8297                </body> 
    8398            </html> 
  • BibIt/trunk/modscoins.xsl

    r944 r953  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
     2<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
     3    xmlns:html="http://www.w3.org/1999/xhtml"  
     4    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
    35    xmlns:mods="http://www.loc.gov/mods/v3" 
    46    xmlns:xlink="http://www.w3.org/1999/xlink" 
     
    182184    </xsl:template> 
    183185 
     186    <xsl:template match="*" mode="coins"/> 
    184187 
    185188</xsl:stylesheet> 
  • BibIt/trunk/modsdetails.xsl

    r944 r953  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
     2<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
     3    xmlns:html="http://www.w3.org/1999/xhtml" 
     4    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
    35    xmlns:mods="http://www.loc.gov/mods/v3"  
    46    xmlns:xlink="http://www.w3.org/1999/xlink" 
     
    2123            <xsl:otherwise>alternate title: </xsl:otherwise> 
    2224        </xsl:choose><xsl:apply-templates select="mods:title" mode="details"/> 
    23         <xsl:if test="@xml:lang"><ul><li>language code for title, per  
    24             <a href="http://rfc.net/rfc4646.html">RFC4646</a>, September 2006 and the  
    25             <a href="http://www.iana.org/assignments/language-subtag-registry">IANA  
    26                 Language Subtag Registry</a>: <xsl:value-of select=" @xml:lang"/></li></ul></xsl:if></li> 
     25        <xsl:if test="@xml:lang"><ul> 
     26            <xsl:variable name="thislang" select="normalize-space(@xml:lang)"/> 
     27            <xsl:choose> 
     28                <xsl:when test="contains(@xml:lang, '-')"> 
     29                    <xsl:for-each select="tokenize(@xml:lang, '-')"> 
     30                        <ul> 
     31                            <xsl:for-each select="$langs/descendant::subtag[. = $thislang]/.."> 
     32                                <li>title <xsl:value-of select="type"/>:<xsl:text> </xsl:text><xsl:value-of select="normalize-space(description)"/></li> 
     33                            </xsl:for-each> 
     34                        </ul> 
     35                    </xsl:for-each> 
     36                </xsl:when> 
     37                <xsl:otherwise> 
     38                    <xsl:variable name="matchedlang" select="$langs/descendant::subtag[. = $thislang]/.."/> 
     39                    <li>title <xsl:value-of select="$matchedlang/type"/>:<xsl:text> </xsl:text><xsl:value-of select="normalize-space($matchedlang/description)"/></li> 
     40                </xsl:otherwise> 
     41            </xsl:choose> 
     42        </ul></xsl:if></li> 
    2743    </xsl:template> 
    2844 
     
    7288 
    7389     
    74     <xsl:template match="mods:identifier[@type != 'isbn' and @type != 'issn']" mode="details"> 
     90    <xsl:template match="mods:identifier[@type != 'isbn' and @type != 'issn' and not(starts-with(., 'awmcbib'))]" mode="details"> 
    7591        <li><xsl:value-of select="@type"/> identifier: <xsl:value-of select="."/></li> 
    7692    </xsl:template> 
     
    103119                    <xsl:element name="a"> 
    104120                        <xsl:attribute name="href"><xsl:value-of select="$parent/@ID"/>.html</xsl:attribute> 
    105                         <xsl:attribute name="title"><xsl:value-of select="$parent/mods:titleInfo[@type='uniform'][1]/mods:title"/></xsl:attribute> 
     121                        <xsl:attribute name="title"><xsl:value-of select="normalize-space($parent/mods:titleInfo[@type='uniform'][1]/mods:title)"/></xsl:attribute> 
    106122                        <xsl:value-of select="$parenttitle"/></xsl:element> 
    107123                </xsl:when> 
     
    109125                    <xsl:element name="a"> 
    110126                        <xsl:attribute name="href"><xsl:value-of select="$parent/@ID"/>.html</xsl:attribute> 
    111                         <xsl:attribute name="title"><xsl:value-of select="$parent/mods:titleInfo[@type='uniform'][1]/mods:title"/></xsl:attribute> 
     127                        <xsl:attribute name="title"><xsl:value-of select="normalize-space($parent/mods:titleInfo[@type='uniform'][1]/mods:title)"/></xsl:attribute> 
    112128                        <xsl:value-of select="$parenttitle"/></xsl:element> 
    113129                    <xsl:text> </xsl:text><xsl:if test="mods:part/mods:detail[@type='volume']"><xsl:value-of select="mods:part/mods:detail[@type='volume']"/></xsl:if> 
     
    118134                    <xsl:element name="a"> 
    119135                        <xsl:attribute name="href"><xsl:value-of select="$parent/@ID"/>.html</xsl:attribute> 
    120                         <xsl:attribute name="title"><xsl:value-of select="$parent/mods:titleInfo[@type='uniform']/mods:title"/></xsl:attribute> 
     136                        <xsl:attribute name="title"><xsl:value-of select="normalize-space($parent/mods:titleInfo[@type='uniform']/mods:title)"/></xsl:attribute> 
    121137                        <xsl:value-of select="$parenttitle"/></xsl:element> 
    122138                    <xsl:text> </xsl:text><xsl:if test="mods:part/mods:detail[@type='volume']"><xsl:value-of select="mods:part/mods:detail[@type='volume']"/></xsl:if> 
     
    126142                    <xsl:element name="a"> 
    127143                        <xsl:attribute name="href"><xsl:value-of select="$parent/@ID"/>.html</xsl:attribute> 
    128                         <xsl:attribute name="title"><xsl:value-of select="$parent/mods:titleInfo[@type='uniform']/mods:title"/></xsl:attribute> 
     144                        <xsl:attribute name="title"><xsl:value-of select="normalize-space($parent/mods:titleInfo[@type='uniform']/mods:title)"/></xsl:attribute> 
    129145                        <xsl:value-of select="$parenttitle"/></xsl:element> 
    130146                    <xsl:if test="mods:part/mods:detail[@type='volume']"><xsl:text> </xsl:text><xsl:value-of select="mods:part/mods:detail[@type='volume']"/></xsl:if>, 
     
    145161        <li>note<xsl:for-each select="@type"><xsl:text> </xsl:text>(<xsl:value-of select="."/>)</xsl:for-each>:</li> 
    146162    </xsl:template> 
     163     
     164    <xsl:template match="mods:recordInfo" mode="details"/> 
     165    <xsl:template match="mods:identifier[@type='local' and starts-with(., 'awmcbib')]" mode="details"/> 
     166    <xsl:template match="mods:extension" mode="details"/> 
    147167 
    148168    <xsl:template match="mods:*" mode="details">