Bugzilla – Attachment 5239 Details for
Bug 6803
Removing remote include in MODS xslt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revised patch
patch.txt (text/plain), 8.88 KB, created by
Marcel de Rooy
on 2011-08-31 12:57:08 UTC
(
hide
)
Description:
Revised patch
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2011-08-31 12:57:08 UTC
Size:
8.88 KB
patch
obsolete
>From 72886d950b969518323c01cacb0cfaea8d9914cf Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 31 Aug 2011 14:42:03 +0200 >Subject: [PATCH] 6803: Removing remote include in MODS xslt >Content-Type: text/plain; charset="utf-8" > >Replacing remote include by local one. >Test this patch by exporting to MODS format from opac-detail page. >This patch does not change any functionality. > >August 31: Does no longer remove carriage returns from xslt file in DOS format. >Note that whitespace errors when applying are caused by these CRs! >--- > .../prog/en/xslt/MARC21slim2MODS3-1.xsl | 4 +- > .../prog/en/xslt/MARC21slimUtils-MODS31.xsl | 189 ++++++++++++++++++++ > 2 files changed, 191 insertions(+), 2 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils-MODS31.xsl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl >index a406b86..8102d21 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS3-1.xsl >@@ -1,6 +1,6 @@ > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet version="1.0" xmlns="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xlink marc"> >- <xsl:include href="http://www.loc.gov/marcxml/xslt/MARC21slimUtils.xsl"/> >+ <xsl:include href="MARC21slimUtils-MODS31.xsl"/> > <xsl:output method="xml" indent="yes" encoding="UTF-8"/> > <!-- > >@@ -2518,4 +2518,4 @@ Added Log Comment > <metaInformation> > <scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/> > </metaInformation> >---> >\ No newline at end of file >+--> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils-MODS31.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils-MODS31.xsl >new file mode 100644 >index 0000000..927d8ae >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils-MODS31.xsl >@@ -0,0 +1,189 @@ >+<?xml version='1.0'?> >+<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" >+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >+ >+ <!-- 08/08/08: tmee added corrected chopPunctuation templates for 260c --> >+ <!-- 08/19/04: ntra added "marc:" prefix to datafield element --> >+ <!-- 12/14/07: ntra added url encoding template --> >+ <!-- url encoding --> >+ >+ <xsl:variable name="ascii"> >+ <xsl:text> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:text> >+ </xsl:variable> >+ >+ <xsl:variable name="latin1"> >+ <xsl:text> ¡¢£¤¥¦§¨©ª«¬Â®¯°±²³´µ¶·¸¹º»¼½¾¿ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃà áâãäåæçèéêëìÃîïðñòóôõö÷øùúûüýþÿ</xsl:text> >+ </xsl:variable> >+ <!-- Characters that usually don't need to be escaped --> >+ <xsl:variable name="safe"> >+ <xsl:text>!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:text> >+ </xsl:variable> >+ >+ <xsl:variable name="hex">0123456789ABCDEF</xsl:variable> >+ >+ >+ <xsl:template name="datafield"> >+ <xsl:param name="tag"/> >+ <xsl:param name="ind1"> >+ <xsl:text> </xsl:text> >+ </xsl:param> >+ <xsl:param name="ind2"> >+ <xsl:text> </xsl:text> >+ </xsl:param> >+ <xsl:param name="subfields"/> >+ <xsl:element name="marc:datafield"> >+ <xsl:attribute name="tag"> >+ <xsl:value-of select="$tag"/> >+ </xsl:attribute> >+ <xsl:attribute name="ind1"> >+ <xsl:value-of select="$ind1"/> >+ </xsl:attribute> >+ <xsl:attribute name="ind2"> >+ <xsl:value-of select="$ind2"/> >+ </xsl:attribute> >+ <xsl:copy-of select="$subfields"/> >+ </xsl:element> >+ </xsl:template> >+ >+ <xsl:template name="subfieldSelect"> >+ <xsl:param name="codes">abcdefghijklmnopqrstuvwxyz</xsl:param> >+ <xsl:param name="delimeter"> >+ <xsl:text> </xsl:text> >+ </xsl:param> >+ <xsl:variable name="str"> >+ <xsl:for-each select="marc:subfield"> >+ <xsl:if test="contains($codes, @code)"> >+ <xsl:value-of select="text()"/> >+ <xsl:value-of select="$delimeter"/> >+ </xsl:if> >+ </xsl:for-each> >+ </xsl:variable> >+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ </xsl:template> >+ >+ <xsl:template name="buildSpaces"> >+ <xsl:param name="spaces"/> >+ <xsl:param name="char"> >+ <xsl:text> </xsl:text> >+ </xsl:param> >+ <xsl:if test="$spaces>0"> >+ <xsl:value-of select="$char"/> >+ <xsl:call-template name="buildSpaces"> >+ <xsl:with-param name="spaces" select="$spaces - 1"/> >+ <xsl:with-param name="char" select="$char"/> >+ </xsl:call-template> >+ </xsl:if> >+ </xsl:template> >+ >+ <xsl:template name="chopPunctuation"> >+ <xsl:param name="chopString"/> >+ <xsl:param name="punctuation"> >+ <xsl:text>.:,;/ </xsl:text> >+ </xsl:param> >+ <xsl:variable name="length" select="string-length($chopString)"/> >+ <xsl:choose> >+ <xsl:when test="$length=0"/> >+ <xsl:when test="contains($punctuation, substring($chopString,$length,1))"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/> >+ <xsl:with-param name="punctuation" select="$punctuation"/> >+ </xsl:call-template> >+ </xsl:when> >+ <xsl:when test="not($chopString)"/> >+ <xsl:otherwise> >+ <xsl:value-of select="$chopString"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> >+ >+ <xsl:template name="chopPunctuationFront"> >+ <xsl:param name="chopString"/> >+ <xsl:variable name="length" select="string-length($chopString)"/> >+ <xsl:choose> >+ <xsl:when test="$length=0"/> >+ <xsl:when test="contains('.:,;/[ ', substring($chopString,1,1))"> >+ <xsl:call-template name="chopPunctuationFront"> >+ <xsl:with-param name="chopString" select="substring($chopString,2,$length - 1)" >+ /> >+ </xsl:call-template> >+ </xsl:when> >+ <xsl:when test="not($chopString)"/> >+ <xsl:otherwise> >+ <xsl:value-of select="$chopString"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> >+ >+ <xsl:template name="chopPunctuationBack"> >+ <xsl:param name="chopString"/> >+ <xsl:param name="punctuation"> >+ <xsl:text>.:,;/] </xsl:text> >+ </xsl:param> >+ <xsl:variable name="length" select="string-length($chopString)"/> >+ <xsl:choose> >+ <xsl:when test="$length=0"/> >+ <xsl:when test="contains($punctuation, substring($chopString,$length,1))"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/> >+ <xsl:with-param name="punctuation" select="$punctuation"/> >+ </xsl:call-template> >+ </xsl:when> >+ <xsl:when test="not($chopString)"/> >+ <xsl:otherwise> >+ <xsl:value-of select="$chopString"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> >+ >+ <!-- nate added 12/14/2007 for lccn.loc.gov: url encode ampersand, etc. --> >+ <xsl:template name="url-encode"> >+ >+ <xsl:param name="str"/> >+ >+ <xsl:if test="$str"> >+ <xsl:variable name="first-char" select="substring($str,1,1)"/> >+ <xsl:choose> >+ <xsl:when test="contains($safe,$first-char)"> >+ <xsl:value-of select="$first-char"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:variable name="codepoint"> >+ <xsl:choose> >+ <xsl:when test="contains($ascii,$first-char)"> >+ <xsl:value-of >+ select="string-length(substring-before($ascii,$first-char)) + 32" >+ /> >+ </xsl:when> >+ <xsl:when test="contains($latin1,$first-char)"> >+ <xsl:value-of >+ select="string-length(substring-before($latin1,$first-char)) + 160"/> >+ <!-- was 160 --> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:message terminate="no">Warning: string contains a character >+ that is out of range! Substituting "?".</xsl:message> >+ <xsl:text>63</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ <xsl:variable name="hex-digit1" >+ select="substring($hex,floor($codepoint div 16) + 1,1)"/> >+ <xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/> >+ <!-- <xsl:value-of select="concat('%',$hex-digit2)"/> --> >+ <xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:if test="string-length($str) > 1"> >+ <xsl:call-template name="url-encode"> >+ <xsl:with-param name="str" select="substring($str,2)"/> >+ </xsl:call-template> >+ </xsl:if> >+ </xsl:if> >+ </xsl:template> >+</xsl:stylesheet> >+<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp. >+<metaInformation> >+<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/> >+</metaInformation> >+--> >+ >-- >1.6.0.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6803
:
5206
|
5239
|
5873
|
6636
|
6698