Changeset 869
- Timestamp:
- 08/02/07 08:49:14 (1 year ago)
- Files:
-
- BibIt/trunk/ProcModsCollection.xsl (modified) (9 diffs)
- BibIt/trunk/getbesttitle.xsl (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
BibIt/trunk/ProcModsCollection.xsl
r868 r869 17 17 Note: this is an xsl 2.0 stylesheet, and therefore requires an xsl 2.0 capable transform engine --> 18 18 19 <xsl:import href="getbesttitle.xsl"/> 19 20 20 21 <!-- ================================================================ … … 23 24 * outpath is the absolute path for writing out all files 24 25 ================================================================ --> 25 26 26 <xsl:param name="mapnum">999</xsl:param> 27 27 <xsl:param name="outpath">/monkeypox/</xsl:param> 28 28 29 30 29 <!-- ================================================================ 31 30 the following xsl:output elements govern each of the various output … … 39 38 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" 40 39 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/> 41 <xsl:output name="mods-format" method="xml" indent="yes" escape-uri-attributes="yes" encoding="UTF-8"/> 40 <xsl:output name="mods-format" method="xml" indent="yes" escape-uri-attributes="yes" encoding="UTF-8" 41 xpath-default-namespace="http://www.loc.gov/mods/v3"/> 42 <xsl:output name="citation-format" method="xml" indent="no" escape-uri-attributes="yes" encoding="UTF-8"/> 42 43 43 44 <xsl:key name="modskeys" match="mods:titleInfo[@type='abbreviated'][1]/mods:title | mods:titleInfo[@type='uniform' and not(../mods:titleInfo/@type='abbreviated')][1]/mods:title" use="ancestor::mods:mods/@ID"/> … … 96 97 </xsl:choose> 97 98 <xsl:element name="br"/> 98 <xsl:choose> 99 <xsl:when test="mods:abstract"> 100 <xsl:element name="span"> 101 <xsl:attribute name="class">formattedcitation</xsl:attribute> 102 <xsl:apply-templates select="mods:abstract/html:p"/> 103 </xsl:element> 104 </xsl:when> 105 <xsl:otherwise> 106 <xsl:apply-templates select="." mode="abstract"/>. 107 </xsl:otherwise> 108 </xsl:choose> 99 <xsl:call-template name="docitation"> 100 <xsl:with-param name="modscit" select="mods:abstract/html:p"/> 101 </xsl:call-template> 109 102 </xsl:element> 110 103 … … 113 106 <xsl:apply-templates select="." mode="copy"/> 114 107 </xsl:result-document> 108 109 <xsl:result-document href="{$outpath}citations/{$newid}.xml" 110 format="citation-format"> 111 <!-- create separate file to hold formatted citation --> 112 <xsl:element name="div" namespace="http://www.w3.org/1999/xhtml"> 113 <xsl:attribute name="id"> 114 <xsl:value-of select="$newid" /> 115 </xsl:attribute> 116 <xsl:call-template name="docitation"><xsl:with-param name="modscit" select="mods:abstract/html:p" /></xsl:call-template> 117 </xsl:element> 118 </xsl:result-document> 119 115 120 116 121 <xsl:result-document href="{$outpath}{$newid}.html" format="record-format" > … … 126 131 <h2>Formatted citation:</h2> 127 132 <ul> 128 <li><xsl:choose> 129 <xsl:when test="mods:abstract"><xsl:apply-templates select="mods:abstract/html:p" /></xsl:when> 130 <xsl:otherwise><xsl:apply-templates select="." mode="abstract"/>.</xsl:otherwise> 131 </xsl:choose></li> 133 <li><xsl:call-template name="docitation"> 134 <xsl:with-param name="modscit" select="mods:abstract/html:p" /> 135 </xsl:call-template></li> 132 136 </ul> 133 137 </div> … … 169 173 </xsl:template> 170 174 171 175 <xsl:template name="docitation"> 176 <xsl:param name="modscit"/> 177 <xsl:choose> 178 <xsl:when test="local-name($modscit) = 'p'"> 179 <xsl:element name="span"> 180 <xsl:attribute name="class">formattedcitation</xsl:attribute> 181 <xsl:copy-of select="$modscit/node()"/> 182 </xsl:element> 183 </xsl:when> 184 <xsl:otherwise> 185 <xsl:apply-templates select="ancestor-or-self::mods:mods" mode="abstract"/>. 186 </xsl:otherwise> 187 </xsl:choose> 188 </xsl:template> 172 189 <!-- ================================================================ 173 190 copy-mode templates are used primarily to copy, suppress or modify … … 748 765 <xsl:value-of select="mods:start"/><xsl:if test="mods:end">-<xsl:value-of select="mods:end"/></xsl:if> 749 766 </xsl:template> 750 <xsl:template match="html:p"><xsl:copy-of select="node()"/></xsl:template>751 767 752 768 <xsl:template name="makenewidold"> … … 874 890 </xsl:template> 875 891 876 <xsl:template name="getbesttitle"> 877 <xsl:choose> 878 <xsl:when test="mods:titleInfo[@type='abbreviated']"> 879 <xsl:value-of select="mods:titleInfo[@type='abbreviated'][1]/mods:title" /> 880 </xsl:when> 881 <xsl:otherwise> 882 <xsl:value-of select="mods:titleInfo[@type='uniform']/mods:title" /> 883 </xsl:otherwise> 884 </xsl:choose> 885 </xsl:template> 886 892 887 893 <xsl:template name="toHex"> 888 894 <xsl:param name="decimalNumber" />
