Advertisement
Guest User

APA Style selected templates

a guest
Dec 7th, 2014
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 26.82 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:t="http://www.microsoft.com/temp">
  4.   <xsl:output method="html" encoding="us-ascii"/>
  5.  
  6.  
  7.  
  8.   <xsl:template match="/">
  9.  
  10.     <xsl:choose>
  11.  
  12.       <xsl:when test="b:Version">
  13.         <xsl:text>2006.5.07</xsl:text>
  14.       </xsl:when>
  15.  
  16.       <xsl:when test="b:OfficeStyleKey">
  17.         <xsl:text>APA</xsl:text>
  18.       </xsl:when>
  19.  
  20.        <xsl:when test="b:XslVersion">
  21.     <xsl:text>6</xsl:text>
  22.       </xsl:when>
  23.  
  24.  
  25.       <xsl:when test="b:StyleNameLocalized">
  26.       <!-- name definitions -->
  27.       </xsl:when>
  28.  
  29.       <xsl:when test="b:GetImportantFields">
  30.        <!-- deleted part -->
  31.       </xsl:when>
  32.  
  33.       <xsl:when test="b:Citation">
  34.         <!-- deleted part -->
  35.       </xsl:when>
  36.  
  37.       <xsl:when test="b:Bibliography">
  38.         <html xmlns:o="urn:schemas-microsoft-com:office:office"
  39.                         xmlns:w="urn:schemas-microsoft-com:office:word"
  40.                         xmlns="http://www.w3.org/TR/REC-html40">
  41.           <head>
  42.            
  43.             <style>
  44.               p.MsoBibliography, li.MsoBibliography, div.MsoBibliography
  45.             </style>
  46.           </head>
  47.  
  48.           <body>
  49.             <xsl:variable name="ListPopulatedWithMain">
  50.               <xsl:call-template name="populateMain">
  51.                 <xsl:with-param name="Type">b:Bibliography</xsl:with-param>
  52.               </xsl:call-template>
  53.             </xsl:variable>
  54.  
  55.             <xsl:variable name="sList">
  56.               <xsl:call-template name="sortedList">
  57.                 <xsl:with-param name="sourceRoot">
  58.                   <xsl:copy-of select="$ListPopulatedWithMain"/>
  59.                 </xsl:with-param>
  60.               </xsl:call-template>
  61.             </xsl:variable>
  62.  
  63.             <xsl:for-each select="msxsl:node-set($sList)/b:Bibliography/b:Source">
  64.  
  65.               <xsl:variable name="LCID">
  66.                 <xsl:choose>
  67.                   <xsl:when test="b:LCID='0' or b:LCID='' or not(b:LCID)">
  68.                     <xsl:value-of select="/*/b:Locals/b:DefaultLCID"/>
  69.                   </xsl:when>
  70.                   <xsl:otherwise>
  71.                     <xsl:value-of select="b:LCID"/>
  72.                   </xsl:otherwise>
  73.                 </xsl:choose>
  74.               </xsl:variable>
  75.  
  76.               <xsl:variable name="dir">
  77.                 <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$LCID]/b:Properties/b:Direction"/>
  78.               </xsl:variable>
  79.  
  80.               <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
  81.               <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
  82.  
  83.               <xsl:element name="p">
  84.                 <xsl:attribute name="lang">
  85.                   <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$LCID]/@Culture"/>
  86.                 </xsl:attribute>
  87.                 <xsl:attribute name="dir">
  88.                   <xsl:value-of select="$dir"/>
  89.                 </xsl:attribute>
  90.                 <xsl:attribute name="class">
  91.                   <xsl:value-of select="'MsoBibliography'"/>
  92.                 </xsl:attribute>
  93.                 <xsl:attribute name="style">
  94.                   <xsl:choose>
  95.                     <xsl:when test="translate($dir,$uppercase,$lowercase)='rtl'">
  96.                       <xsl:value-of select="'margin-right:.5in;text-indent:-.5in'"/>
  97.                     </xsl:when>
  98.                     <xsl:otherwise>
  99.                       <xsl:value-of select="'margin-left:.5in;text-indent:-.5in'"/>
  100.                     </xsl:otherwise>
  101.                   </xsl:choose>
  102.                 </xsl:attribute>
  103.  
  104.                 <xsl:variable name="prevBook">
  105.                   <xsl:value-of select="position()-1"/>
  106.                 </xsl:variable>
  107.  
  108.                 <xsl:variable name="cEditors">
  109.                   <xsl:value-of select="count(b:Author/b:Editor/b:NameList/b:Person)"/>
  110.                 </xsl:variable>
  111.  
  112.            <!--  [deleted part] defintion of lots of other variables -->
  113.  
  114.                 <xsl:variable name="tempRDAFU">
  115.                   <xsl:call-template name="templateRDAFU"/>
  116.                 </xsl:variable>
  117.  
  118.  
  119.             <!-- [deletet part] defintion of lots of other variables -->
  120.  
  121.                   <xsl:when test="string-length($doi)>0">
  122.                     <xsl:value-of select="$doiPrefix"/>
  123.                     <xsl:call-template name="templ_prop_Enum"/>
  124.                     <xsl:value-of select="$doi"/>
  125.                   </xsl:when>
  126.                   <xsl:when test="string-length($tempRDAFU)>0">
  127.                     <xsl:value-of select="$tempRDAFU"/>
  128.                   </xsl:when>
  129.                 </xsl:choose>
  130.               </xsl:element>
  131.              
  132.             </xsl:for-each>
  133.  
  134.           </body>
  135.         </html>
  136.       </xsl:when>
  137.     </xsl:choose>
  138.   </xsl:template>
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.   <xsl:template name="templateRDAFU">
  147.  
  148.  
  149.     <xsl:variable name="dac">
  150.       <xsl:call-template name="formatDateAccessed"/>
  151.     </xsl:variable>
  152.  
  153.     <xsl:variable name="internetSiteTitleAndURL">
  154.  
  155.       <xsl:if test="string-length(b:InternetSiteTitle)>0">
  156.         <xsl:if test="string-length(b:URL)>0">
  157.           <xsl:value-of select="b:InternetSiteTitle"/>
  158.         </xsl:if>
  159.         <xsl:if test="string-length(b:URL)=0">
  160.           <xsl:call-template name="appendField_Dot">
  161.             <xsl:with-param name="field" select="b:InternetSiteTitle"/>
  162.           </xsl:call-template>
  163.         </xsl:if>
  164.       </xsl:if>
  165.  
  166.       <xsl:if test="string-length(b:InternetSiteTitle)>0 and string-length(b:URL)>0">
  167.         <xsl:call-template name="templ_prop_EnumSeparator"/>
  168.       </xsl:if>
  169.  
  170.       <xsl:if test="string-length(b:URL)>0">
  171.         <xsl:value-of select="b:URL"/>
  172.       </xsl:if>
  173.     </xsl:variable>
  174.  
  175.     <xsl:variable name="str_RetrievedFromCap">
  176.       <xsl:call-template name="templ_str_RetrievedFromCap"/>
  177.     </xsl:variable>
  178.  
  179.     <xsl:variable name="str_RetrievedCap">
  180.       <xsl:call-template name="templ_str_RetrievedCap"/>
  181.     </xsl:variable>
  182.  
  183.     <xsl:variable name="str_FromCap">
  184.       <xsl:call-template name="templ_str_FromCap"/>
  185.     </xsl:variable>
  186.  
  187.     <xsl:variable name="temp">
  188.       <xsl:choose>
  189.         <xsl:when test="string-length($dac)>0 and string-length($internetSiteTitleAndURL)>0">
  190.           <xsl:call-template name="StringFormat">
  191.             <xsl:with-param name="format" select="$str_RetrievedFromCap"/>
  192.             <xsl:with-param name="parameters">
  193.               <t:params>
  194.                 <t:param>
  195.                   <xsl:value-of select="$dac"/>
  196.                 </t:param>
  197.                 <t:param>
  198.                   <xsl:value-of select="$internetSiteTitleAndURL"/>
  199.                 </t:param>
  200.               </t:params>
  201.             </xsl:with-param>
  202.           </xsl:call-template>
  203.         </xsl:when>
  204.  
  205.         <xsl:when test="string-length($dac)>0">
  206.           <xsl:call-template name="StringFormat">
  207.             <xsl:with-param name="format" select="$str_RetrievedCap"/>
  208.             <xsl:with-param name="parameters">
  209.               <t:params>
  210.                 <t:param>
  211.                   <xsl:value-of select="$dac"/>
  212.                 </t:param>
  213.               </t:params>
  214.             </xsl:with-param>
  215.           </xsl:call-template>
  216.         </xsl:when>
  217.  
  218.         <xsl:when test="string-length($internetSiteTitleAndURL)>0">
  219.           <xsl:call-template name="StringFormat">
  220.             <xsl:with-param name="format" select="$str_FromCap"/>
  221.             <xsl:with-param name="parameters">
  222.               <t:params>
  223.                 <t:param>
  224.                   <xsl:value-of select="$internetSiteTitleAndURL"/>
  225.                 </t:param>
  226.               </t:params>
  227.             </xsl:with-param>
  228.           </xsl:call-template>
  229.         </xsl:when>
  230.       </xsl:choose>
  231.     </xsl:variable>
  232.     <xsl:value-of select="$temp"/>
  233.   </xsl:template>
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  <xsl:template name="formatDateAccessed">
  240.     <xsl:call-template name="formatDateCore">
  241.       <xsl:with-param name="day">
  242.         <xsl:call-template name="handleSpaces">
  243.           <xsl:with-param name="field" select="b:DayAccessed"/>
  244.         </xsl:call-template>
  245.       </xsl:with-param>
  246.       <xsl:with-param name="month">
  247.         <xsl:call-template name="handleSpaces">
  248.           <xsl:with-param name="field" select="b:MonthAccessed"/>
  249.         </xsl:call-template>
  250.       </xsl:with-param>
  251.       <xsl:with-param name="year">
  252.         <xsl:call-template name="handleSpaces">
  253.           <xsl:with-param name="field" select="b:YearAccessed"/>
  254.         </xsl:call-template>
  255.       </xsl:with-param>
  256.  
  257.       <xsl:with-param name="DMY">
  258.         <xsl:call-template name="templ_prop_APA_DateAccessed_DMY"/>
  259.       </xsl:with-param>
  260.       <xsl:with-param name="DM">
  261.         <xsl:call-template name="templ_prop_APA_DateAccessed_DM"/>
  262.       </xsl:with-param>
  263.       <xsl:with-param name="MY">
  264.         <xsl:call-template name="templ_prop_APA_DateAccessed_MY"/>
  265.       </xsl:with-param>
  266.       <xsl:with-param name="DY">
  267.         <xsl:call-template name="templ_prop_APA_DateAccessed_DY"/>
  268.       </xsl:with-param>
  269.  
  270.       <xsl:with-param name="displayND">no</xsl:with-param>
  271.     </xsl:call-template>
  272.   </xsl:template>
  273.  
  274.  
  275.  
  276.  
  277.  
  278.   <xsl:template name="formatDateCore">
  279.     <xsl:param name="day"/>
  280.     <xsl:param name="month"/>
  281.     <xsl:param name="year"/>
  282.     <xsl:param name="displayND"/>
  283.  
  284.     <xsl:param name="DMY"/>
  285.     <xsl:param name="DM"/>
  286.     <xsl:param name="MY"/>
  287.     <xsl:param name="DY"/>
  288.  
  289.     <xsl:choose>
  290.       <xsl:when test="string-length($year)=0">
  291.         <xsl:if test="$displayND = 'yes'">
  292.           <xsl:call-template name="templ_str_NoDateShortUnCap"/>
  293.         </xsl:if>
  294.       </xsl:when>
  295.       <xsl:otherwise>
  296.         <xsl:call-template name="formatDateCorePrivate">
  297.           <xsl:with-param name="day" select="$day"/>
  298.           <xsl:with-param name="month" select="$month"/>
  299.           <xsl:with-param name="year" select="$year"/>
  300.  
  301.           <xsl:with-param name="DMY" select="$DMY"/>
  302.           <xsl:with-param name="DM" select="$DM"/>
  303.           <xsl:with-param name="MY" select="$MY"/>
  304.           <xsl:with-param name="DY" select="$DY"/>
  305.         </xsl:call-template>
  306.       </xsl:otherwise>
  307.     </xsl:choose>
  308.  
  309.   </xsl:template>
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.   <xsl:template name="formatDateCorePrivate">
  317.         <xsl:param name="DMY"/>
  318.         <xsl:param name="DM"/>
  319.         <xsl:param name="MY"/>
  320.         <xsl:param name="DY"/>
  321.  
  322.         <xsl:param name="day"/>
  323.         <xsl:param name="month"/>
  324.         <xsl:param name="year"/>
  325.        
  326.         <xsl:param name="withDot"/>
  327.        
  328.         <xsl:variable name="format">
  329.             <xsl:choose>
  330.                 <xsl:when test="string-length($day) = 0 and string-length($month) = 0 and string-length($year) = 0 ">
  331.                 </xsl:when>
  332.                 <xsl:when test="string-length($day) = 0 and string-length($month) = 0 and string-length($year) != 0 ">
  333.                     <xsl:call-template name="templ_prop_SimpleDate_Y" />
  334.                 </xsl:when>
  335.                 <xsl:when test="string-length($day) = 0 and string-length($month) != 0 and string-length($year) = 0 ">
  336.                 </xsl:when>
  337.                 <xsl:when test="string-length($day) = 0 and string-length($month) != 0 and string-length($year) != 0 ">
  338.                     <xsl:value-of select="$MY"/>
  339.                 </xsl:when>
  340.                 <xsl:when test="string-length($day) != 0 and string-length($month) = 0 and string-length($year) = 0 ">
  341.                 </xsl:when>
  342.                 <xsl:when test="string-length($day) != 0 and string-length($month) = 0 and string-length($year) != 0 ">
  343.                     <xsl:call-template name="templ_prop_SimpleDate_Y" />
  344.                 </xsl:when>
  345.                 <xsl:when test="string-length($day) != 0 and string-length($month) != 0 and string-length($year) = 0 ">
  346.                 </xsl:when>
  347.                 <xsl:when test="string-length($day) != 0 and string-length($month) != 0 and string-length($year) != 0 ">
  348.                     <xsl:value-of select="$DMY"/>
  349.                 </xsl:when>
  350.             </xsl:choose>
  351.         </xsl:variable>
  352.        
  353.         <xsl:call-template name="StringFormatDate">
  354.             <xsl:with-param name="format" select="$format"/>
  355.  
  356.             <xsl:with-param name="day" select="$day"/>
  357.             <xsl:with-param name="month" select="$month"/>
  358.             <xsl:with-param name="year" select="$year"/>
  359.  
  360.             <xsl:with-param name="withDot" select="$withDot"/>
  361.         </xsl:call-template>
  362.        
  363.     </xsl:template>  
  364.  
  365.    
  366.    
  367.    
  368.    
  369.    
  370.    
  371.   <xsl:template name="StringFormatDate">
  372.         <xsl:param name="format" />
  373.        
  374.         <xsl:param name="day"/>
  375.         <xsl:param name="month"/>
  376.         <xsl:param name="year"/>       
  377.        
  378.         <xsl:param name="withDot" />
  379.  
  380.     <xsl:variable name="prop_EndChars">
  381.       <xsl:call-template name="templ_prop_EndChars"/>
  382.     </xsl:variable>
  383.  
  384.     <xsl:choose>
  385.             <xsl:when test="$format = ''"></xsl:when>
  386.             <xsl:when test="substring($format, 1, 2) = '%%'">
  387.                 <xsl:text>%</xsl:text>
  388.                 <xsl:call-template name="StringFormatDate">
  389.                     <xsl:with-param name="format" select="substring($format, 3)" />
  390.                     <xsl:with-param name="day" select="$day"/>
  391.                     <xsl:with-param name="month" select="$month"/>
  392.                     <xsl:with-param name="year" select="$year"/>
  393.                     <xsl:with-param name="withDot" select="$withDot" />
  394.                 </xsl:call-template>
  395.                 <xsl:if test="string-length($format)=2 and withDot = 'yes' and not(contains($prop_EndChars, '%'))">
  396.                     <xsl:call-template name="templ_prop_Dot"/>
  397.                 </xsl:if>
  398.             </xsl:when>
  399.             <xsl:when test="substring($format, 1, 1) = '%'">
  400.                 <xsl:variable name="what" select="substring($format, 2, 1)" />
  401.                 <xsl:choose>
  402.                     <xsl:when test="$what = 'D'">
  403.                         <xsl:value-of select="$day"/>
  404.                     </xsl:when>
  405.                     <xsl:when test="$what = 'M'">
  406.                         <xsl:value-of select="$month"/>
  407.                     </xsl:when>
  408.                     <xsl:when test="$what = 'Y'">
  409.                         <xsl:value-of select="$year"/>
  410.                     </xsl:when>
  411.                 </xsl:choose>
  412.                 <xsl:call-template name="StringFormatDate">
  413.                     <xsl:with-param name="format" select="substring($format, 3)" />
  414.                     <xsl:with-param name="day" select="$day"/>
  415.                     <xsl:with-param name="month" select="$month"/>
  416.                     <xsl:with-param name="year" select="$year"/>
  417.                     <xsl:with-param name="withDot" select="$withDot" />
  418.                 </xsl:call-template>
  419.                 <xsl:if test="string-length($format)=2 and withDot='yes'">
  420.                     <xsl:variable name="temp2">
  421.                         <xsl:call-template name="handleSpaces">
  422.                             <xsl:with-param name="field">
  423.                                 <xsl:call-template name="formatNameOneItem">
  424.                                     <xsl:with-param name="format" select="$what"/>
  425.                                 </xsl:call-template>
  426.                             </xsl:with-param>
  427.                         </xsl:call-template>
  428.                     </xsl:variable>            
  429.                     <xsl:variable name="lastChar">
  430.                         <xsl:value-of select="substring($temp2, string-length($temp2))"/>
  431.                     </xsl:variable>
  432.                     <xsl:if test="not(contains($prop_EndChars, $lastChar))">
  433.                         <xsl:call-template name="templ_prop_Dot"/>
  434.                     </xsl:if>
  435.                 </xsl:if>
  436.             </xsl:when>
  437.             <xsl:otherwise>
  438.                 <xsl:value-of select="substring($format, 1, 1)" />
  439.                 <xsl:call-template name="StringFormatDate">
  440.                     <xsl:with-param name="format" select="substring($format, 2)" />
  441.                     <xsl:with-param name="day" select="$day"/>
  442.                     <xsl:with-param name="month" select="$month"/>
  443.                     <xsl:with-param name="year" select="$year"/>
  444.                     <xsl:with-param name="withDot" select="$withDot" />
  445.                 </xsl:call-template>
  446.                 <xsl:if test="string-length($format)=1">
  447.                     <xsl:if test="withDot = 'yes' and not(contains($prop_EndChars, $format))">
  448.                         <xsl:call-template name="templ_prop_Dot"/>
  449.                     </xsl:if>
  450.                 </xsl:if>
  451.             </xsl:otherwise>
  452.         </xsl:choose>
  453.     </xsl:template>
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.   <xsl:template name="appendField_Dot">
  461.     <xsl:param name="field"/>
  462.  
  463.     <xsl:variable name="temp">
  464.       <xsl:call-template name="handleSpaces">
  465.         <xsl:with-param name="field" select="$field"/>
  466.       </xsl:call-template>
  467.     </xsl:variable>
  468.  
  469.     <xsl:variable name="lastChar">
  470.       <xsl:value-of select="substring($temp, string-length($temp))"/>
  471.     </xsl:variable>
  472.  
  473.     <xsl:variable name="prop_EndChars">
  474.       <xsl:call-template name="templ_prop_EndChars"/>
  475.     </xsl:variable>
  476.  
  477.     <xsl:choose>
  478.       <xsl:when test="string-length($temp) = 0">
  479.       </xsl:when>
  480.       <xsl:when test="contains($prop_EndChars, $lastChar)">
  481.         <xsl:value-of select="$temp"/>
  482.       </xsl:when>
  483.       <xsl:otherwise>
  484.         <xsl:value-of select="$temp"/>
  485.         <xsl:call-template name="templ_prop_Dot"/>
  486.       </xsl:otherwise>
  487.     </xsl:choose>
  488.  
  489.   </xsl:template>
  490.  
  491.  
  492.  
  493.  
  494.     <xsl:template name="templ_prop_EnumSeparator" >
  495.     <xsl:param name="LCID" />
  496.     <xsl:variable name="_LCID">
  497.       <xsl:call-template name="localLCID">
  498.         <xsl:with-param name="LCID" select="$LCID"/>
  499.       </xsl:call-template>
  500.     </xsl:variable>
  501.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:General/b:EnumSeparator"/>
  502.   </xsl:template>
  503.  
  504.  
  505.  
  506.  
  507.     <xsl:template name="templ_str_RetrievedFromCap" >
  508.     <xsl:param name="LCID" />
  509.     <xsl:variable name="_LCID">
  510.       <xsl:call-template name="localLCID">
  511.         <xsl:with-param name="LCID" select="$LCID"/>
  512.       </xsl:call-template>
  513.     </xsl:variable>
  514.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedFromCap"/>
  515.   </xsl:template>
  516.  
  517.  
  518.  
  519.   <xsl:template name="templ_str_RetrievedCap" >
  520.     <xsl:param name="LCID" />
  521.     <xsl:variable name="_LCID">
  522.       <xsl:call-template name="localLCID">
  523.         <xsl:with-param name="LCID" select="$LCID"/>
  524.       </xsl:call-template>
  525.     </xsl:variable>
  526.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedCap"/>
  527.   </xsl:template>
  528.  
  529.  
  530.    <xsl:template name="templ_str_FromCap" >
  531.     <xsl:param name="LCID" />
  532.     <xsl:variable name="_LCID">
  533.       <xsl:call-template name="localLCID">
  534.         <xsl:with-param name="LCID" select="$LCID"/>
  535.       </xsl:call-template>
  536.     </xsl:variable>
  537.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:FromCap"/>
  538.   </xsl:template>
  539.  
  540.  
  541.  
  542.   <xsl:template name="StringFormatName">
  543.         <xsl:param name="format" />
  544.         <xsl:param name="withDot" />
  545.         <xsl:param name="upperLast"/>
  546.  
  547.     <xsl:variable name="prop_EndChars">
  548.       <xsl:call-template name="templ_prop_EndChars"/>
  549.     </xsl:variable>
  550.  
  551.     <xsl:choose>
  552.             <xsl:when test="$format = ''"></xsl:when>
  553.             <xsl:when test="substring($format, 1, 2) = '%%'">
  554.                 <xsl:text>%</xsl:text>
  555.                 <xsl:call-template name="StringFormatName">
  556.                     <xsl:with-param name="format" select="substring($format, 3)" />
  557.                     <xsl:with-param name="withDot" select="$withDot" />
  558.                     <xsl:with-param name="upperLast" select="$upperLast" />
  559.                 </xsl:call-template>
  560.        
  561.                 <xsl:if test="string-length($format)=2 and withDot = 'yes' and not(contains($prop_EndChars, '%'))">
  562.                     <xsl:call-template name="templ_prop_Dot"/>
  563.                 </xsl:if>
  564.             </xsl:when>
  565.             <xsl:when test="substring($format, 1, 1) = '%'">
  566.                 <xsl:variable name="what" select="substring($format, 2, 1)" />
  567.                
  568.                 <xsl:choose>
  569.                     <xsl:when test="(what = 'l' or what = 'L') and upperLast = 'yes'">
  570.                         <span style='text-transform: uppercase;'>
  571.                             <xsl:call-template name="formatNameOneItem">
  572.                                 <xsl:with-param name="format" select="$what"/>
  573.                             </xsl:call-template>
  574.                         </span>
  575.                     </xsl:when>
  576.                     <xsl:otherwise>
  577.                         <xsl:call-template name="formatNameOneItem">
  578.                             <xsl:with-param name="format" select="$what"/>
  579.                         </xsl:call-template>
  580.                     </xsl:otherwise>
  581.                 </xsl:choose>
  582.                 <xsl:call-template name="StringFormatName">
  583.                     <xsl:with-param name="format" select="substring($format, 3)" />
  584.                     <xsl:with-param name="withDot" select="$withDot" />
  585.                     <xsl:with-param name="upperLast" select="$upperLast" />
  586.                 </xsl:call-template>
  587.                 <xsl:if test="string-length($format)=2 and withDot='yes'">
  588.                     <xsl:variable name="temp2">
  589.                         <xsl:call-template name="handleSpaces">
  590.                             <xsl:with-param name="field">
  591.                                 <xsl:call-template name="formatNameOneItem">
  592.                                     <xsl:with-param name="format" select="$what"/>
  593.                                 </xsl:call-template>
  594.                             </xsl:with-param>
  595.                         </xsl:call-template>
  596.                     </xsl:variable>            
  597.                     <xsl:variable name="lastChar">
  598.                         <xsl:value-of select="substring($temp2, string-length($temp2))"/>
  599.                     </xsl:variable>
  600.                     <xsl:if test="not(contains($prop_EndChars, $lastChar))">
  601.                         <xsl:call-template name="templ_prop_Dot"/>
  602.                     </xsl:if>
  603.                 </xsl:if>
  604.             </xsl:when>
  605.             <xsl:otherwise>
  606.                 <xsl:value-of select="substring($format, 1, 1)" />
  607.                 <xsl:call-template name="StringFormatName">
  608.                     <xsl:with-param name="format" select="substring($format, 2)" />
  609.                     <xsl:with-param name="withDot" select="$withDot" />
  610.                     <xsl:with-param name="upperLast" select="$upperLast" />
  611.                 </xsl:call-template>
  612.                 <xsl:if test="string-length($format)=1">
  613.                     <xsl:if test="withDot = 'yes' and not(contains($prop_EndChars, $format))">
  614.                         <xsl:call-template name="templ_prop_Dot"/>
  615.                     </xsl:if>
  616.                 </xsl:if>
  617.             </xsl:otherwise>
  618.         </xsl:choose>
  619.     </xsl:template>
  620.    
  621.    
  622.    
  623.    
  624.     <xsl:template name="handleSpaces">
  625.     <xsl:param name="field"/>
  626.  
  627.     <xsl:variable name="prop_NormalizeSpace">
  628.       <xsl:call-template name="templ_prop_NormalizeSpace"/>
  629.     </xsl:variable>
  630.  
  631.     <xsl:choose>
  632.       <xsl:when test="$prop_NormalizeSpace='yes'">
  633.         <xsl:value-of select="normalize-space($field)"/>
  634.       </xsl:when>
  635.       <xsl:otherwise>
  636.         <xsl:value-of select="$field"/>
  637.       </xsl:otherwise>
  638.     </xsl:choose>
  639.   </xsl:template>
  640.  
  641.  
  642.  
  643.  
  644.   <xsl:template name="templ_prop_APA_DateAccessed_DMY" >
  645.     <xsl:param name="LCID" />
  646.     <xsl:variable name="_LCID">
  647.       <xsl:call-template name="localLCID">
  648.         <xsl:with-param name="LCID" select="$LCID"/>
  649.       </xsl:call-template>
  650.     </xsl:variable>
  651.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:DateAccessed/b:DMY"/>
  652.   </xsl:template>
  653.  
  654.  
  655.   <xsl:template name="templ_prop_APA_DateAccessed_DM" >
  656.     <xsl:param name="LCID" />
  657.     <xsl:variable name="_LCID">
  658.       <xsl:call-template name="localLCID">
  659.         <xsl:with-param name="LCID" select="$LCID"/>
  660.       </xsl:call-template>
  661.     </xsl:variable>
  662.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:DateAccessed/b:DM"/>
  663.   </xsl:template>
  664.  
  665.  
  666.   <xsl:template name="templ_prop_APA_DateAccessed_MY" >
  667.     <xsl:param name="LCID" />
  668.     <xsl:variable name="_LCID">
  669.       <xsl:call-template name="localLCID">
  670.         <xsl:with-param name="LCID" select="$LCID"/>
  671.       </xsl:call-template>
  672.     </xsl:variable>
  673.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:DateAccessed/b:MY"/>
  674.   </xsl:template>
  675.  
  676.  
  677.   <xsl:template name="templ_prop_APA_DateAccessed_DY" >
  678.     <xsl:param name="LCID" />
  679.     <xsl:variable name="_LCID">
  680.       <xsl:call-template name="localLCID">
  681.         <xsl:with-param name="LCID" select="$LCID"/>
  682.       </xsl:call-template>
  683.     </xsl:variable>
  684.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:DateAccessed/b:DY"/>
  685.   </xsl:template>
  686.  
  687.  
  688.  
  689.  
  690.   <xsl:template name="templ_str_NoDateShortUnCap" >
  691.     <xsl:param name="LCID" />
  692.     <xsl:variable name="_LCID">
  693.       <xsl:call-template name="localLCID">
  694.         <xsl:with-param name="LCID" select="$LCID"/>
  695.       </xsl:call-template>
  696.     </xsl:variable>
  697.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:NoDateShortUnCap"/>
  698.   </xsl:template>
  699.  
  700.  
  701.  
  702.     <xsl:template name="templ_prop_SimpleDate_Y" >
  703.   <xsl:text>%Y</xsl:text>
  704.     </xsl:template>
  705.  
  706.  
  707.  
  708.  
  709.  
  710.     <xsl:template name="templ_prop_EndChars" >
  711.     <xsl:param name="LCID" />
  712.     <xsl:variable name="_LCID">
  713.       <xsl:call-template name="localLCID">
  714.         <xsl:with-param name="LCID" select="$LCID"/>
  715.       </xsl:call-template>
  716.     </xsl:variable>
  717.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:General/b:EndChars"/>
  718.   </xsl:template>
  719.  
  720.  
  721.  
  722.  
  723.     <xsl:template name="templ_prop_Dot" >
  724.     <xsl:param name="LCID" />
  725.     <xsl:variable name="_LCID">
  726.       <xsl:call-template name="localLCID">
  727.         <xsl:with-param name="LCID" select="$LCID"/>
  728.       </xsl:call-template>
  729.     </xsl:variable>
  730.     <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:General/b:Dot"/>
  731.   </xsl:template>
  732.  
  733.  
  734.  
  735.  
  736.   <xsl:template name="formatNameOneItem">
  737.     <xsl:param name="format"/>
  738.  
  739.     <xsl:choose>
  740.       <xsl:when test="$format = 'F'">
  741.         <xsl:value-of select="b:First"/>
  742.       </xsl:when>
  743.       <xsl:when test="$format = 'L'">
  744.         <xsl:value-of select="b:Last"/>
  745.       </xsl:when>
  746.       <xsl:when test="$format = 'M'">
  747.         <xsl:value-of select="b:Middle"/>
  748.       </xsl:when>
  749.       <xsl:when test="$format = 'f'">
  750.         <xsl:call-template name="formatNameInitial">
  751.           <xsl:with-param name="name" select="b:First"/>
  752.         </xsl:call-template>
  753.       </xsl:when>
  754.       <xsl:when test="$format = 'm'">
  755.         <xsl:call-template name="formatNameInitial">
  756.           <xsl:with-param name="name" select="b:Middle"/>
  757.         </xsl:call-template>
  758.       </xsl:when>
  759.       <xsl:when test="$format = 'l'">
  760.         <xsl:call-template name="formatNameInitial">
  761.           <xsl:with-param name="name" select="b:Last"/>
  762.         </xsl:call-template>
  763.       </xsl:when>
  764.     </xsl:choose>
  765.  
  766.   </xsl:template>
  767.  
  768.  
  769.  
  770.  
  771.   <xsl:template name="localLCID">
  772.     <xsl:param name="LCID"/>
  773.  
  774.     <xsl:variable name="_LCID1">
  775.       <xsl:choose>
  776.         <xsl:when test="$LCID!='0' and $LCID!=''">
  777.           <xsl:value-of select="$LCID"/>
  778.         </xsl:when>
  779.         <xsl:when test="/b:Citation">
  780.           <xsl:value-of select="/*/b:Locals/b:DefaultLCID"/>
  781.         </xsl:when>
  782.         <xsl:when test="b:LCID">
  783.           <xsl:value-of select="b:LCID"/>
  784.         </xsl:when>
  785.         <xsl:when test="../b:LCID">
  786.           <xsl:value-of select="../b:LCID"/>
  787.         </xsl:when>
  788.         <xsl:when test="../../b:LCID">
  789.           <xsl:value-of select="../../b:LCID"/>
  790.         </xsl:when>
  791.         <xsl:when test="../../../b:LCID">
  792.           <xsl:value-of select="../../../b:LCID"/>
  793.         </xsl:when>
  794.         <xsl:when test="../../../../b:LCID">
  795.           <xsl:value-of select="../../../../b:LCID"/>
  796.         </xsl:when>
  797.         <xsl:when test="../../../../b:LCID">
  798.           <xsl:value-of select="../../../../b:LCID"/>
  799.         </xsl:when>
  800.         <xsl:when test="../../../../../b:LCID">
  801.           <xsl:value-of select="../../../../../b:LCID"/>
  802.         </xsl:when>
  803.         <xsl:otherwise>
  804.           <xsl:value-of select="/*/b:Locals/b:DefaultLCID"/>
  805.         </xsl:otherwise>
  806.       </xsl:choose>
  807.     </xsl:variable>
  808.  
  809.     <xsl:choose>
  810.       <xsl:when test="$_LCID1!='0' and string-length($_LCID1)>0">
  811.         <xsl:value-of select="$_LCID1"/>
  812.       </xsl:when>
  813.       <xsl:otherwise>
  814.         <xsl:value-of select="/*/b:Locals/b:DefaultLCID"/>
  815.       </xsl:otherwise>
  816.     </xsl:choose>
  817.  
  818.   </xsl:template>
  819.  
  820.  
  821.  
  822.  
  823.     <xsl:template name="templ_prop_NormalizeSpace" >
  824.     <xsl:param name="LCID" />
  825.     <xsl:variable name="_LCID">
  826.       <xsl:call-template name="localLCID">
  827.         <xsl:with-param name="LCID" select="$LCID"/>
  828.       </xsl:call-template>
  829.     </xsl:variable>
  830.     <xsl:text>no</xsl:text>
  831.    
  832.   </xsl:template>
  833.  
  834.  
  835.   </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement