<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ags="http://purl.org/agmes/1.1/"
  xmlns:agls="http://www.naa.gov.au/recordkeeping/gov_online/agls/1.2"
  xmlns:s="http://subjectClassifications.data"
  ept:name="DC"
  ept:visible="all"
  ept:advertise="1"
  ept:sourceNamespace="http://purl.org/dc/elements/1.1/"       
  ept:targetNamespace="http://eprints.org/ep2/data/2.0"
  ept:produce="list/eprint"
  xmlns:ept="http://eprints.org/ep2/xslt/1.0"
  xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:opf="http://www.idpf.org/2007/opf"
  xmlns:dcterms="http://purl.org/dc/terms/">

<!-- Key and variable declarations for the look-up tables -->
<xsl:key name="subjectClassification-lookup" match="s:subjectClassification" use="s:code1"/>
<xsl:variable name="subjectClassifications-top" select="document('')/*/s:subjectClassifications"/>

<xsl:template match="/">
<eprints>

<xsl:apply-templates select="agrisResources"/>
</eprints>
</xsl:template>

<xsl:template match="agrisResources">

  <!-- main loop to process each ASFA record -->
  
  <xsl:for-each select="agrisResource">

    <xsl:variable name="edition" select="dc:description/ags:descriptionEdition"/>
    <!-- Set variable acDocType to the type of Aquatic Commons document that is required -->

    <xsl:variable name="acDocType">
    <xsl:choose>
      <xsl:when test ="dc:type[position()=last()]='Dissertation/Thesis'">thesis</xsl:when>      
      <xsl:when test ="dc:type[position()=1]='Drawing/Photograph'">image</xsl:when>       
      <xsl:when test ="dc:type[position()=1]='Atlas/Map/Cartographic'">charts_and_maps</xsl:when>                                       
      <xsl:when test="@bibliographicLevel='M' and dc:type[position()=1]='Report'">monograph</xsl:when>                                
      <xsl:when test="@bibliographicLevel='M'">book</xsl:when>                                                         
      <xsl:when test="@bibliographicLevel='MS'">monograph</xsl:when>                                                                 
      <xsl:when test="@bibliographicLevel='AS'">article</xsl:when>                                                    
      <xsl:when test="@bibliographicLevel='AM'">book_section</xsl:when>                                                                           
      <xsl:when test="@bibliographicLevel='AMS'">conference_item</xsl:when>                                                                                    
      <xsl:when test="@bibliographicLevel='C'">conference_item</xsl:when>
      <xsl:otherwise>book</xsl:otherwise>                                                                               
    </xsl:choose>            
    </xsl:variable>

    <eprint>
      
    <documents><document><language><xsl:value-of select="dc:language"/></language></document></documents> 

    <type><xsl:value-of select="$acDocType" /></type>  

    <output_media>
    <xsl:for-each select="dc:type">
      <xsl:if test="normalize-space(.) and position() != 1 and position() != last()">
        <xsl:value-of select="normalize-space(.)"/>
        <xsl:if test="not(position() = last()-1)">;</xsl:if>
      </xsl:if>                        
    </xsl:for-each>       
    </output_media>      
   
    <xsl:for-each select="dc:title">       
      <xsl:choose>
        <xsl:when test="@xml:lang='en'">
          <xsl:variable name="titleWithinBrackets" select="substring-after(substring-before(text(),']'),'[')"/>
          <xsl:choose>          
            <xsl:when test="$titleWithinBrackets">
              <title><xsl:value-of select="$titleWithinBrackets"/><xsl:if test="$edition"><xsl:text>. </xsl:text><xsl:value-of select="$edition"/></xsl:if></title>          
            </xsl:when>
            <xsl:otherwise>
              <title><xsl:value-of select="text()"/><xsl:if test="$edition"><xsl:text>. </xsl:text><xsl:value-of select="$edition"/></xsl:if></title>            
            </xsl:otherwise>            
          </xsl:choose>          
        </xsl:when>          
        <xsl:otherwise>
          <alter_title><xsl:value-of select="text()"/></alter_title>
        </xsl:otherwise>
      </xsl:choose>                
    </xsl:for-each>

    <xsl:for-each select="dc:identifier[@scheme='ags:ISBN']">         
      <isbn><xsl:value-of select="text()"/></isbn>       
    </xsl:for-each>

    <xsl:for-each select="dc:identifier[@scheme='dcterms:URI']">     
      <xsl:if test="position()=1"><!-- avoids the possible output of multiple official_url tags which causes the Aquatic Commons Import to crash -->             
        <official_url><xsl:value-of select="text()"/></official_url> 
      </xsl:if>
      <xsl:if test="position()=last()"><!-- avoids the possibility of generating the same data as is contained in the official_url tag, and of generating multiple related_url tags which causes the Aquatic Commons Import to crash -->             
        <related_url_url><xsl:value-of select="text()"/></related_url_url>
      </xsl:if>                                                              
    </xsl:for-each>

    <id_number>
    <xsl:for-each select=" dc:identifier[@scheme='ags:JN']/text() | dc:identifier[@scheme='ags:DOI']/text()">
      <xsl:if test="normalize-space(.)">
        <xsl:value-of select="normalize-space(.)"/>
        <xsl:if test="not(position() = last())">;</xsl:if>
      </xsl:if>      
    </xsl:for-each>    
    </id_number>
                       
    <keywords>
    <xsl:for-each select="dc:subject/text() | dc:subject/ags:subjectThesaurus/text()">
      <xsl:if test="normalize-space(.)">
        <xsl:value-of select="normalize-space(.)"/>
        <xsl:if test="not(position() = last())">;</xsl:if>
      </xsl:if>      
    </xsl:for-each>
    </keywords>

    <issn>
    <xsl:for-each select="ags:citation/ags:citationIdentifier[@scheme='ags:ISSN'] | ags:citation/ags:citationElectronicISSN ">      
      <xsl:if test="normalize-space(.)">      
        <xsl:value-of select="normalize-space(.)"/>                
        <xsl:if test="not(position() = last())">;</xsl:if>
      </xsl:if>      
    </xsl:for-each>    
    </issn>
    
    <note>
    <xsl:for-each select="dc:description/ags:descriptionNotes | ags:citation/ags:citationChronology ">      
      <xsl:if test="normalize-space(.)">
        <xsl:if test="name(.)='ags:descriptionNotes'"><xsl:value-of select="normalize-space(.)"/></xsl:if>
        <xsl:if test="name(.)='ags:citationChronology'">Edition(collection):<xsl:value-of select="normalize-space(.)"/></xsl:if>           
        <xsl:if test="not(position() = last())">;</xsl:if>
      </xsl:if>      
    </xsl:for-each>
    </note>

    <xsl:apply-templates select="dc:subject"/>

    <xsl:apply-templates select="dc:publisher"/>

    <xsl:apply-templates select="dc:description"/>

    <xsl:apply-templates select="dc:format"/>

    <xsl:apply-templates select="dc:creator"/> 

    <xsl:apply-templates select="ags:citation[position()=1]"/>

    <!-- The date will cause the entire record to be rejected by the Acquatic Commons import unless it is numeric -->
    <xsl:if test="number(dc:date/dcterms:dateIssued)">             
      <date><xsl:value-of select="dc:date/dcterms:dateIssued"/></date>    
    </xsl:if>
 
    </eprint>    
  </xsl:for-each>  
</xsl:template>

<!-- When processing specific to a particular type of worksheet is required, the "mode" can be specified -->

<xsl:template match="dc:subject">
  
  <xsl:if test="ags:subjectClassification"> 
    <subjects>      
    <xsl:for-each select="ags:subjectClassification">
      <xsl:variable name="subjectClassificationContent" select="."/>
      <xsl:variable name="subjectClassificationContentLen" select="string-length($subjectClassificationContent)"/>
      <xsl:variable name="subjectClassificationCodeLen" select="4"/>
      <xsl:variable name="subjectClassificationCode" select="substring($subjectClassificationContent,$subjectClassificationContentLen - ($subjectClassificationCodeLen -1),$subjectClassificationContentLen + 1)"/>

      <xsl:if test="number($subjectClassificationCode)">        
        <xsl:apply-templates select="$subjectClassifications-top">     
          <xsl:with-param name="curr-subjectClassification" select="$subjectClassificationCode"/>
        </xsl:apply-templates>
      </xsl:if>                
    </xsl:for-each>
    </subjects>        
  </xsl:if>  
</xsl:template>

<xsl:template match="dc:publisher">
  <xsl:if test="ags:publisherName">
    <publisher><xsl:value-of select="ags:publisherName/text()"/></publisher>  
  </xsl:if>
  <xsl:if test="ags:publisherPlace">
    <place_of_pub><xsl:value-of select="ags:publisherPlace/text()"/></place_of_pub>  
  </xsl:if>    
</xsl:template>

<xsl:template match="dc:format">
  <xsl:if test="dcterms:extent">  
    <!-- Extract the volume data -->
    <xsl:variable name="volumePlus" select="substring-after(dcterms:extent/text(),'vol.')"/>  
    <xsl:variable name="volumeTerminated" select="substring-before($volumePlus,',')"/>  
    <xsl:choose>
      <xsl:when test="string-length($volumeTerminated)=0">
        <xsl:if test="string-length($volumePlus)>0">              
          <volume><xsl:value-of select="$volumePlus"/></volume>
        </xsl:if>                
      </xsl:when>
      <xsl:otherwise>
        <volume><xsl:value-of select="$volumeTerminated"/></volume>    
      </xsl:otherwise>    
    </xsl:choose>              

    <!-- Extract the number data -->        
    <xsl:variable name="numberPlus" select="substring-after(dcterms:extent/text(),'issue:')"/>  
    <xsl:variable name="numberTerminated" select="substring-before($numberPlus,'p.')"/>      
    <xsl:choose>
      <xsl:when test="string-length($numberTerminated)=0">
        <xsl:if test="string-length($numberPlus)>0">              
          <number><xsl:value-of select="$numberPlus"/></number>
        </xsl:if>                
      </xsl:when>
      <xsl:otherwise>
        <number><xsl:value-of select="$numberTerminated"/></number>    
      </xsl:otherwise>    
    </xsl:choose>   

    <!-- Extract the pagination data -->
    <!-- The Acquatic Commons import crashes if the pages element contains anything other than a numeric value, -->    
    <!-- or the pagerange element contains anything other than two numerics seperated by a hyphen.              -->    
    <xsl:variable name="pagAfterPDot" select="substring-after(dcterms:extent/text(),'p.')"/>    
    <xsl:if test="string-length($pagAfterPDot)>0">
      <xsl:variable name="pagAfterPDotAndBeforeP" select="substring-before($pagAfterPDot,'p')"/>
      <!-- Ideally, a variable containing the parsed pagination data would be set at this point, -->
      <!-- but this is not possible in xslt, hence the code-repetition in the two branches.      -->
      <xsl:choose>
        <xsl:when test="string-length($pagAfterPDotAndBeforeP)>0">
          <xsl:choose>
            <xsl:when test="number($pagAfterPDotAndBeforeP)">     
              <pages><xsl:value-of select="$pagAfterPDotAndBeforeP"/></pages>
            </xsl:when>
            <xsl:otherwise>
              <xsl:variable name="pagBeforeHyphen" select="substring-before($pagAfterPDotAndBeforeP,'-')"/>          
              <xsl:if test="number($pagBeforeHyphen)">
                <xsl:variable name="pagAfterHyphen" select="substring-after($pagAfterPDotAndBeforeP,'-')"/>         
                <xsl:if test="number($pagAfterHyphen)">
                  <pagerange><xsl:value-of select="$pagBeforeHyphen"/><xsl:text>-</xsl:text><xsl:value-of select="$pagAfterHyphen"/></pagerange>                         
                </xsl:if>                               
              </xsl:if>                                 
            </xsl:otherwise>
          </xsl:choose>      
        </xsl:when>
        <xsl:otherwise>        
          <xsl:choose>
            <xsl:when test="number($pagAfterPDot)">     
              <pages><xsl:value-of select="$pagAfterPDot"/></pages>
            </xsl:when>
            <xsl:otherwise>
              <xsl:variable name="pagBeforeHyphen" select="substring-before($pagAfterPDot,'-')"/>          
              <xsl:if test="number($pagBeforeHyphen)">
                <xsl:variable name="pagAfterHyphen" select="substring-after($pagAfterPDot,'-')"/>         
                <xsl:if test="number($pagAfterHyphen)">
                  <pagerange><xsl:value-of select="$pagBeforeHyphen"/><xsl:text>-</xsl:text><xsl:value-of select="$pagAfterHyphen"/></pagerange>                         
                </xsl:if>                               
              </xsl:if>                                 
            </xsl:otherwise>
          </xsl:choose>                   
        </xsl:otherwise>
      </xsl:choose>                                                                       
    </xsl:if>
  </xsl:if>
</xsl:template>

<xsl:template match="dc:description">    
  <xsl:for-each select="dcterms:abstract">  
    <xsl:if test="@xml:lang='en'">
      <xsl:variable name="preDBOAbstractData" select="substring-before(text(),'(DBO)')"/>
      <xsl:choose>                        
        <xsl:when test="string-length($preDBOAbstractData)>0">
          <abstract><xsl:value-of select="$preDBOAbstractData"/></abstract>          
        </xsl:when>          
        <xsl:otherwise>
          <abstract><xsl:value-of select="text()"/></abstract>       
        </xsl:otherwise>                 
      </xsl:choose>                     
    </xsl:if>          
  </xsl:for-each>        
</xsl:template>

<xsl:template match="dc:creator">
  <creators>   
    <xsl:for-each select="ags:creatorPersonal">  
        <item>      
          <name>
            <!-- The ASFA element can contain author-address-data from tag 509 that is contained in brackets and so not required -->
            <xsl:variable name="preBracketPersonalData" select="substring-before(text(),'(')"/>
            <xsl:variable name="allPersonalData" select="text()"/>
            <xsl:choose>                        
              <xsl:when test="string-length($preBracketPersonalData)>0">
                <xsl:variable name="commaDelimitedFamilyName" select="substring-before($preBracketPersonalData,',')"/>
                <xsl:choose>
                  <xsl:when test="string-length($commaDelimitedFamilyName)>0">                                                          
                    <family><xsl:value-of select="$commaDelimitedFamilyName"/></family>
                    <given><xsl:value-of select="substring-after($preBracketPersonalData,',')"/></given>                  
                  </xsl:when>          
                  <xsl:otherwise>
                    <family><xsl:value-of select="$preBracketPersonalData"/></family>
                    <given><xsl:value-of select="$preBracketPersonalData"/></given>                                                    
                  </xsl:otherwise>
                </xsl:choose>  
              </xsl:when>
              <xsl:otherwise>
                <xsl:variable name="commaDelimitedFamilyName" select="substring-before($allPersonalData,',')"/>
                <xsl:choose>
                  <xsl:when test="string-length($commaDelimitedFamilyName)>0">                                                          
                    <family><xsl:value-of select="$commaDelimitedFamilyName"/></family>
                    <given><xsl:value-of select="substring-after($allPersonalData,',')"/></given>                  
                  </xsl:when>          
                  <xsl:otherwise>
                    <family><xsl:value-of select="$allPersonalData"/></family>
                    <given><xsl:value-of select="$allPersonalData"/></given>                                                    
                  </xsl:otherwise>
                </xsl:choose>                              
              </xsl:otherwise>                 
            </xsl:choose>                         
          </name>
        </item>
    </xsl:for-each>
  </creators>
  <corp_creators>    
    <xsl:for-each select="ags:creatorCorporate">
      <item><xsl:value-of select="text()"/></item>
    </xsl:for-each>
  </corp_creators>

  <xsl:if test="ags:creatorConference">
    <xsl:variable name="dataBeforeFirstComma" select="substring-before(ags:creatorConference,',')"/>
    <xsl:choose>  
      <xsl:when test="string-length($dataBeforeFirstComma)>0">
        <event_title>Conference:<xsl:value-of select="$dataBeforeFirstComma"/></event_title>
        <xsl:variable name="dataAfterFirstComma" select="substring-after(ags:creatorConference,',')"/>
        <xsl:variable name="dataBetweenFirstAndSecondComma" select="substring-before($dataAfterFirstComma,',')"/>                    
        <xsl:choose>          
          <xsl:when test="string-length($dataBetweenFirstAndSecondComma)>0">
            <event_location><xsl:value-of select="$dataBetweenFirstAndSecondComma"/></event_location>
            <xsl:variable name="dataAfterSecondComma" select="substring-after($dataAfterFirstComma,',')"/>        
            <xsl:if test="string-length($dataAfterSecondComma)>0">
              <event_dates><xsl:value-of select="$dataAfterSecondComma"/></event_dates>          
            </xsl:if>
          </xsl:when>                              
          <xsl:otherwise>
            <event_location><xsl:value-of select="$dataAfterFirstComma"/></event_location>                    
          </xsl:otherwise>    
        </xsl:choose>                 
      </xsl:when>
      <xsl:otherwise>
        <event_title>Conference:<xsl:value-of select="ags:creatorConference"/></event_title>      
      </xsl:otherwise>          
    </xsl:choose>        
  </xsl:if>      
</xsl:template>

<xsl:template match="ags:citation[position()=1]"><!-- The first position has to be specified because ASFA output can contain more than one ags:citation which can result in more than one publication and series elements being created which causes Acquatic Commons Import to crash -->
  <xsl:for-each select="ags:citationTitle">
    <xsl:if test="position()=1">
      <!-- It should be in the publication element for Acquatic Commons article type documents. For all others it should be in series. Both can be output as the other is ignored -->    
      <publication><xsl:value-of select="text()"/></publication>    
      <series><xsl:value-of select="text()"/></series>     
    </xsl:if>    
  </xsl:for-each>     
</xsl:template>


<!-- Process subject-classification look ups -->

<xsl:template match="s:subjectClassifications">
  <xsl:param name="curr-subjectClassification"/>
  <xsl:variable name="match-for-code" select="key('subjectClassification-lookup', $curr-subjectClassification)/s:code2"/>
  <xsl:if test="string($match-for-code)" >  
    <item><xsl:value-of select="$match-for-code" /></item>
  </xsl:if>    
</xsl:template>
 
<!-- Look-up table for subject-classification mapping -->

<s:subjectClassifications>
  <s:subjectClassification><s:code1>1101</s:code1><s:code2>P</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1102</s:code1><s:code2>P</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1103</s:code1><s:code2>P</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1104</s:code1><s:code2>P</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1105</s:code1><s:code2>P</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1106</s:code1><s:code2>P</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1107</s:code1><s:code2>P</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1108</s:code1><s:code2>P</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1109</s:code1><s:code2>P</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1110</s:code1><s:code2>P</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1121</s:code1><s:code2>P</s:code2></s:subjectClassification>
  
  <s:subjectClassification><s:code1>1181</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1182</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1183</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1184</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1185</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1186</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1187</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1201</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1202</s:code1><s:code2>D</s:code2></s:subjectClassification>    
  <s:subjectClassification><s:code1>1203</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1204</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1205</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1206</s:code1><s:code2>D</s:code2></s:subjectClassification>    
  <s:subjectClassification><s:code1>1201</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1221</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1222</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1223</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1224</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1225</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1226</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1241</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1242</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1243</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1244</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1245</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1246</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1261</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1262</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1263</s:code1><s:code2>D</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1264</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1265</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1266</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1281</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1282</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1283</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1284</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1285</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1286</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1301</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1302</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1303</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1304</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1305</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1306</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1321</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1322</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1323</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1324</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1325</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1326</s:code1><s:code2>D</s:code2></s:subjectClassification>
     
  <s:subjectClassification><s:code1>1341</s:code1><s:code2>M</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1342</s:code1><s:code2>M</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1343</s:code1><s:code2>M</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1344</s:code1><s:code2>M</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1345</s:code1><s:code2>M</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1346</s:code1><s:code2>M</s:code2></s:subjectClassification>
     
  <s:subjectClassification><s:code1>1361</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1362</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1363</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1364</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1365</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1366</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1371</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1372</s:code1><s:code2>D</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1373</s:code1><s:code2>D</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1374</s:code1><s:code2>D</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1375</s:code1><s:code2>D</s:code2></s:subjectClassification>       
  <s:subjectClassification><s:code1>1376</s:code1><s:code2>D</s:code2></s:subjectClassification>
      
  <s:subjectClassification><s:code1>1381</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1382</s:code1><s:code2>H</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1383</s:code1><s:code2>H</s:code2></s:subjectClassification>        
  <s:subjectClassification><s:code1>1421</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1422</s:code1><s:code2>H</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1423</s:code1><s:code2>H</s:code2></s:subjectClassification>    
  <s:subjectClassification><s:code1>1424</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1425</s:code1><s:code2>H</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1441</s:code1><s:code2>H</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1442</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1443</s:code1><s:code2>H</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1461</s:code1><s:code2>H</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1462</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1463</s:code1><s:code2>H</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1464</s:code1><s:code2>H</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1481</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1482</s:code1><s:code2>H</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1483</s:code1><s:code2>H</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1484</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>1485</s:code1><s:code2>H</s:code2></s:subjectClassification>     
  <s:subjectClassification><s:code1>1541</s:code1><s:code2>H</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1542</s:code1><s:code2>H</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>1561</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1562</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1563</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1564</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1565</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1566</s:code1><s:code2>M</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1567</s:code1><s:code2>M</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>1581</s:code1><s:code2>C</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1582</s:code1><s:code2>C</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1583</s:code1><s:code2>C</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1584</s:code1><s:code2>C</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1585</s:code1><s:code2>C</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1586</s:code1><s:code2>C</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1587</s:code1><s:code2>C</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1588</s:code1><s:code2>C</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>1601</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1602</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1603</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1604</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1605</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1621</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1622</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1623</s:code1><s:code2>M</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1624</s:code1><s:code2>M</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>1625</s:code1><s:code2>O</s:code2></s:subjectClassification>
  
  <s:subjectClassification><s:code1>1626</s:code1><s:code2>M</s:code2></s:subjectClassification>
  
  <s:subjectClassification><s:code1>1627</s:code1><s:code2>O</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>1641</s:code1><s:code2>S</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1642</s:code1><s:code2>S</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1643</s:code1><s:code2>S</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>1644</s:code1><s:code2>S</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>1645</s:code1><s:code2>S</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>2101</s:code1><s:code2>G</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>2102</s:code1><s:code2>P</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2103</s:code1><s:code2>P</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2104</s:code1><s:code2>P</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2105</s:code1><s:code2>P</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2106</s:code1><s:code2>P</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2107</s:code1><s:code2>P</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2108</s:code1><s:code2>P</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2109</s:code1><s:code2>P</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2110</s:code1><s:code2>P</s:code2></s:subjectClassification>     
  
  <s:subjectClassification><s:code1>2121</s:code1><s:code2>Q</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2122</s:code1><s:code2>Q</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2123</s:code1><s:code2>Q</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2124</s:code1><s:code2>Q</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2125</s:code1><s:code2>Q</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>2126</s:code1><s:code2>X</s:code2></s:subjectClassification>
     
  <s:subjectClassification><s:code1>2127</s:code1><s:code2>Q</s:code2></s:subjectClassification>
   
  <s:subjectClassification><s:code1>2141</s:code1><s:code2>D</s:code2></s:subjectClassification>
     
  <s:subjectClassification><s:code1>2142</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2144</s:code1><s:code2>H</s:code2></s:subjectClassification>       
  <s:subjectClassification><s:code1>2146</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2148</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2150</s:code1><s:code2>H</s:code2></s:subjectClassification> 
         
  <s:subjectClassification><s:code1>2161</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2162</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2163</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  
  <s:subjectClassification><s:code1>2164</s:code1><s:code2>T</s:code2></s:subjectClassification>
     
  <s:subjectClassification><s:code1>2165</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2166</s:code1><s:code2>H</s:code2></s:subjectClassification>        
  <s:subjectClassification><s:code1>2167</s:code1><s:code2>H</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2168</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2169</s:code1><s:code2>H</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2170</s:code1><s:code2>H</s:code2></s:subjectClassification>
       
  <s:subjectClassification><s:code1>2171</s:code1><s:code2>R</s:code2></s:subjectClassification>
     
  <s:subjectClassification><s:code1>2181</s:code1><s:code2>E</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2182</s:code1><s:code2>E</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2183</s:code1><s:code2>E</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2184</s:code1><s:code2>E</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2185</s:code1><s:code2>E</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>2186</s:code1><s:code2>E</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2187</s:code1><s:code2>E</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2188</s:code1><s:code2>E</s:code2></s:subjectClassification>
       
  <s:subjectClassification><s:code1>2201</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2202</s:code1><s:code2>H</s:code2></s:subjectClassification>    
  <s:subjectClassification><s:code1>2203</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2204</s:code1><s:code2>H</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2205</s:code1><s:code2>H</s:code2></s:subjectClassification>
     
  <s:subjectClassification><s:code1>2221</s:code1><s:code2>H</s:code2></s:subjectClassification>      
  <s:subjectClassification><s:code1>2222</s:code1><s:code2>H</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2223</s:code1><s:code2>H</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2225</s:code1><s:code2>H</s:code2></s:subjectClassification>
   
  <s:subjectClassification><s:code1>2241</s:code1><s:code2>A</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2242</s:code1><s:code2>A</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2243</s:code1><s:code2>A</s:code2></s:subjectClassification>      
  <s:subjectClassification><s:code1>2244</s:code1><s:code2>A</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2245</s:code1><s:code2>A</s:code2></s:subjectClassification>
     
  <s:subjectClassification><s:code1>2261</s:code1><s:code2>G</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2262</s:code1><s:code2>G</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2263</s:code1><s:code2>G</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2264</s:code1><s:code2>G</s:code2></s:subjectClassification>      
  <s:subjectClassification><s:code1>2265</s:code1><s:code2>G</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2266</s:code1><s:code2>G</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2267</s:code1><s:code2>G</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2268</s:code1><s:code2>G</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2269</s:code1><s:code2>G</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2270</s:code1><s:code2>G</s:code2></s:subjectClassification>      
  <s:subjectClassification><s:code1>2271</s:code1><s:code2>G</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2272</s:code1><s:code2>G</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2273</s:code1><s:code2>G</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2274</s:code1><s:code2>G</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>2281</s:code1><s:code2>K</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2282</s:code1><s:code2>K</s:code2></s:subjectClassification>      
  <s:subjectClassification><s:code1>2283</s:code1><s:code2>K</s:code2></s:subjectClassification> 
  <s:subjectClassification><s:code1>2284</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2301</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2302</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2303</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2321</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2322</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2323</s:code1><s:code2>K</s:code2></s:subjectClassification>    
  <s:subjectClassification><s:code1>2324</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2325</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2326</s:code1><s:code2>K</s:code2></s:subjectClassification>    
  <s:subjectClassification><s:code1>2327</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2341</s:code1><s:code2>K</s:code2></s:subjectClassification>
      
  <s:subjectClassification><s:code1>2342</s:code1><s:code2>O</s:code2></s:subjectClassification>    

  <s:subjectClassification><s:code1>2343</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2344</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2345</s:code1><s:code2>K</s:code2></s:subjectClassification>
  
  <s:subjectClassification><s:code1>2346</s:code1><s:code2>O</s:code2></s:subjectClassification>
  
  <s:subjectClassification><s:code1>2381</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2382</s:code1><s:code2>K</s:code2></s:subjectClassification>
  
  <s:subjectClassification><s:code1>2383</s:code1><s:code2>P</s:code2></s:subjectClassification>
  
  <s:subjectClassification><s:code1>2384</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2385</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2386</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2387</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2388</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2389</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2390</s:code1><s:code2>K</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2391</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2392</s:code1><s:code2>K</s:code2></s:subjectClassification>
  <s:subjectClassification><s:code1>2393</s:code1><s:code2>K</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>2401</s:code1><s:code2>L</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2402</s:code1><s:code2>L</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2403</s:code1><s:code2>L</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2404</s:code1><s:code2>L</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2405</s:code1><s:code2>L</s:code2></s:subjectClassification>    
  <s:subjectClassification><s:code1>2406</s:code1><s:code2>L</s:code2></s:subjectClassification>    

  <s:subjectClassification><s:code1>2421</s:code1><s:code2>S</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2422</s:code1><s:code2>S</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2423</s:code1><s:code2>S</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>2424</s:code1><s:code2>S</s:code2></s:subjectClassification>    
  <s:subjectClassification><s:code1>2425</s:code1><s:code2>S</s:code2></s:subjectClassification>  

  <s:subjectClassification><s:code1>3501</s:code1><s:code2>W</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>3502</s:code1><s:code2>W</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>3503</s:code1><s:code2>W</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>3504</s:code1><s:code2>W</s:code2></s:subjectClassification>
      
  <s:subjectClassification><s:code1>3505</s:code1><s:code2>F</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>3521</s:code1><s:code2>W</s:code2></s:subjectClassification>
    
  <s:subjectClassification><s:code1>3522</s:code1><s:code2>F</s:code2></s:subjectClassification>  
  <s:subjectClassification><s:code1>3523</s:code1><s:code2>F</s:code2></s:subjectClassification>   
  <s:subjectClassification><s:code1>3524</s:code1><s:code2>F</s:code2></s:subjectClassification>  
                           
</s:subjectClassifications>

</xsl:stylesheet>