Changeset 1105

Show
Ignore:
Timestamp:
08/28/07 15:22:41 (1 year ago)
Author:
thomase
Message:

construct more effective worldcat urls for issns (to ensure we actuallly hit the journal page and not some random article); make more useful wild web search term sets

Files:

Legend:

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

    r1067 r1105  
    5959                <xsl:variable name="issn"><xsl:value-of select="mods:identifier[@type='issn'][1]" /></xsl:variable> 
    6060                <li><xsl:element name="a"> 
    61                           <xsl:attribute name="href">http://worldcat.org/issn/<xsl:value-of select="$issn" /></xsl:attribute> 
    62                           Search WorldCat using ISSN = <xsl:value-of select="$issn" /></xsl:element></li> 
     61                          <xsl:attribute name="href">http://www.worldcat.org/search?q=issn%3A<xsl:value-of select="$issn" />+dt%3Aser</xsl:attribute> 
     62                          Search WorldCat for a serial using ISSN = <xsl:value-of select="$issn" /></xsl:element></li> 
    6363            </xsl:if> 
    6464        </ul> 
     
    112112        </ul> 
    113113        <!-- string search the wild web --> 
     114        <xsl:variable name="websearchterms"> 
     115        <xsl:choose> 
     116            <xsl:when test="$genre = 'ancient literary work'"><xsl:value-of select="replace(normalize-space(mods:note[@type='citation']), ' ', '+')"/></xsl:when> 
     117            <xsl:when test="count(tokenize($readytitle, '\+')) &lt; 2"> 
     118                <xsl:choose> 
     119                    <xsl:when test="mods:name[1]/mods:displayForm"><xsl:value-of select="replace(normalize-space(mods:name[1]/mods:displayForm), ' ', '+')"/></xsl:when> 
     120                    <xsl:when test="mods:name[1]/mods:namePart[@type='family'] and mods:name[1]/mods:namePart[@type='given']" 
     121                        ><xsl:value-of select="replace(normalize-space(replace(mods:name[1]/mods:namePart[@type='given'], '\.', ' ')), ' ', '+')" 
     122                        />+<xsl:value-of select="replace(normalize-space(mods:name[1]/mods:namePart[@type='family']), ' ', '+')"/></xsl:when> 
     123                    <xsl:when test="mods:name[1]/mods:namePart"> 
     124                        <xsl:for-each select="mods:name[1]/mods:namePart" 
     125                            ><xsl:value-of select="replace(normalize-space(.), ' ', '+')"/></xsl:for-each> 
     126                    </xsl:when> 
     127                </xsl:choose>+<xsl:value-of select="replace(normalize-space(mods:titleInfo[@type != 'abbreviated'][1]/mods:title), ' ', '+')"/> 
     128            </xsl:when> 
     129            <xsl:otherwise><xsl:value-of select="$readytitle"/></xsl:otherwise> 
     130        </xsl:choose> 
     131        </xsl:variable> 
     132        <xsl:variable name="readablesearchterms"> 
     133            <xsl:choose> 
     134                <xsl:when test="$genre = 'ancient literary work'"><xsl:value-of select="normalize-space(mods:note[@type='citation'])"/></xsl:when> 
     135            <xsl:when test="count(tokenize($readytitle, '\+')) &lt; 2"> 
     136                <xsl:choose> 
     137                    <xsl:when test="mods:name[1]/mods:displayForm"><xsl:value-of select="normalize-space(mods:name[1]/mods:displayForm)"/></xsl:when> 
     138                    <xsl:when test="mods:name[1]/mods:namePart[@type='family'] and mods:name[1]/mods:namePart[@type='given']"> 
     139                        <xsl:value-of select="normalize-space(mods:name[1]/mods:namePart[@type='given'])"/><xsl:text> </xsl:text> 
     140                        <xsl:value-of select="normalize-space(mods:name[1]/mods:namePart[@type='family'])"/> 
     141                    </xsl:when> 
     142                     <xsl:when test="mods:name[1]/mods:namePart"> 
     143            <xsl:for-each select="mods:name[1]/mods:namePart"> 
     144                <xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text> 
     145            </xsl:for-each> 
     146                          
     147                     </xsl:when>    
     148                </xsl:choose> 
     149                <xsl:text> </xsl:text><xsl:value-of select="normalize-space(mods:titleInfo[@type != 'abbreviated'][1]/mods:title)"/></xsl:when> 
     150            <xsl:otherwise><xsl:value-of select="$thetitle"/></xsl:otherwise> 
     151            </xsl:choose> 
     152        </xsl:variable> 
    114153        <ul> 
    115154            <li><xsl:element name="a"> 
    116                       <xsl:attribute name="href">http://www.google.com/search?as_q=<xsl:value-of select="$readytitle" /></xsl:attribute> 
    117                       Search the web with Google using the words ("<xsl:value-of select="$thetitle" />")</xsl:element></li> 
     155                      <xsl:attribute name="href">http://www.google.com/search?as_q=<xsl:value-of select="replace($websearchterms, ',', '')" /></xsl:attribute> 
     156                      Search the web with Google using the words ("<xsl:value-of select="replace($readablesearchterms, ',', '')" />")</xsl:element></li> 
    118157            <li><xsl:element name="a"> 
    119                       <xsl:attribute name="href">http://search.live.com/results.aspx?q=<xsl:value-of select="$readytitle" /></xsl:attribute> 
    120                       Search the web with Live Search using the words ("<xsl:value-of select="$thetitle" />")</xsl:element></li> 
     158                      <xsl:attribute name="href">http://search.live.com/results.aspx?q=<xsl:value-of select="replace($websearchterms, ',', '')" /></xsl:attribute> 
     159                      Search the web with Live Search using the words ("<xsl:value-of select="replace($readablesearchterms, ',', '')" />")</xsl:element></li> 
    121160            <!-- evidently yahoo requires an application ID before we can construct query strings --> 
    122161