﻿<?xml version="1.0" encoding="utf-8"?>
<root>
    <nstable>
        <item prefix="marc" url="http://dp2003.com/UNIMARC" />
    </nstable>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='010']/marc:subfield[@code='a']</xpath>
        <from>ISBN</from>
        <table ref="ISBN" />
    </key>
    <table name="ISBN" id="0" type="isbn">
        <convert>
            <string style="#convertISBN,stopword" stopwordTable="title" />
        </convert>
        <convertquery>
            <string style="#convertISBN,stopword" stopwordTable="title" />
        </convertquery>
        <caption lang="zh-cn">ISBN</caption>
        <caption lang="en">ISBN</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='011']/marc:subfield[@code='a']</xpath>
        <from>ISSN</from>
        <table ref="ISSN" />
    </key>
    <table name="ISSN" id="1" type="issn">
        <convert>
            <string style="#convertISSN,stopword" stopwordTable="title" />
        </convert>
        <convertquery>
            <string style="#convertISSN,stopword" stopwordTable="title" />
        </convertquery>
        <caption lang="zh-cn">ISSN</caption>
        <caption lang="en">ISSN</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='200']/marc:subfield[@code='a']</xpath>
        <from>title</from>
        <table ref="title" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='225']/marc:subfield[@code='a']</xpath>
        <from>title</from>
        <table ref="title" />
    </key>
    <table name="title" id="2" type="title">
        <convert>
            <string style="upper,stopword,simplify" stopwordTable="title" />
        </convert>
        <convertquery>
            <string style="upper,stopword,simplify" stopwordTable="title" />
        </convertquery>
        <caption lang="zh-cn">题名</caption>
        <caption lang="en">Title</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='200']/marc:subfield[@code='A']</xpath>
        <from>titlePinyin</from>
        <table ref="titlePinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='225']/marc:subfield[@code='A']</xpath>
        <from>titlePinyin</from>
        <table ref="titlePinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='200']/marc:subfield[@code='9']</xpath>
        <from>titlePinyin</from>
        <table ref="titlePinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='225']/marc:subfield[@code='9']</xpath>
        <from>titlePinyin</from>
        <table ref="titlePinyin" />
    </key>
    <table name="titlePinyin" id="3" type="pinyin_title">
        <convert>
            <string style="upper,pinyinab" />
        </convert>
        <convertquery>
            <string style="upper,pinyinab" />
        </convertquery>
        <caption lang="zh-cn">题名拼音</caption>
        <caption lang="en">Title pinyin</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='606']/marc:subfield[@code='a']</xpath>
        <from>Thesaurus</from>
        <table ref="Thesaurus" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='610']/marc:subfield[@code='a']</xpath>
        <from>Thesaurus</from>
        <table ref="Thesaurus" />
    </key>
    <table name="Thesaurus" id="4" type="subject">
        <convert>
            <string style="upper,simplify,split" />
        </convert>
        <convertquery>
            <string style="upper,simplify" />
        </convertquery>
        <caption lang="zh-cn">主题词</caption>
        <caption lang="en">Thesaurus</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='690']/marc:subfield[@code='a']</xpath>
        <from>class</from>
        <table ref="class" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='692']/marc:subfield[@code='a']</xpath>
        <from>class</from>
        <table ref="class" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='694']/marc:subfield[@code='a']</xpath>
        <from>class</from>
        <table ref="class" />
    </key>
    <table name="class" id="6" type="class">
        <convert>
            <string style="upper" />
        </convert>
        <convertquery>
            <string style="upper" />
        </convertquery>
        <caption lang="zh-cn">分类号</caption>
        <caption lang="en">Class number</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='700']/marc:subfield[@code='a']</xpath>
        <from>contributor</from>
        <table ref="contributor" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='701']/marc:subfield[@code='a']</xpath>
        <from>contributor</from>
        <table ref="contributor" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='702']/marc:subfield[@code='a']</xpath>
        <from>contributor</from>
        <table ref="contributor" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='710']/marc:subfield[@code='a']</xpath>
        <from>contributor</from>
        <table ref="contributor" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='711']/marc:subfield[@code='a']</xpath>
        <from>contributor</from>
        <table ref="contributor" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='712']/marc:subfield[@code='a']</xpath>
        <from>contributor</from>
        <table ref="contributor" />
    </key>
    <table name="contributor" id="7" type="contributor">
        <convert>
            <string style="upper,stopword,simplify" stopwordTable="title" />
        </convert>
        <convertquery>
            <string style="upper,stopword,simplify" stopwordTable="title" />
        </convertquery>
        <caption lang="zh-cn">责任者</caption>
        <caption lang="en">Contributor</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='700']/marc:subfield[@code='9']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='701']/marc:subfield[@code='9']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='702']/marc:subfield[@code='9']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='710']/marc:subfield[@code='9']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='711']/marc:subfield[@code='9']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='712']/marc:subfield[@code='9']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='700']/marc:subfield[@code='A']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='701']/marc:subfield[@code='A']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='702']/marc:subfield[@code='A']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='710']/marc:subfield[@code='A']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='711']/marc:subfield[@code='A']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='712']/marc:subfield[@code='A']</xpath>
        <from>contributorPinyin</from>
        <table ref="contributorPinyin" />
    </key>
    <table name="contributorPinyin" id="8" type="pinyin_contributor">
        <convert>
            <string style="upper,pinyinab" />
        </convert>
        <convertquery>
            <string style="upper,pinyinab" />
        </convertquery>
        <caption lang="zh-cn">责任者拼音</caption>
        <caption lang="en">Contributor pinyin</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='210']/marc:subfield[@code='c']</xpath>
        <from>publisher</from>
        <table ref="publisher" />
    </key>
    <table name="publisher" id="9" type="publisher">
        <convert>
            <string style="upper" />
        </convert>
        <convertquery>
            <string style="upper" />
        </convertquery>
        <caption lang="zh-cn">出版发行者</caption>
        <caption lang="en">Publisher</caption>
    </table>
    <key>
        <xpath nstable="">concat(/marc:record/marc:datafield[@tag='905']/marc:subfield[@code='d'],"/",/marc:record/marc:datafield[@tag='905']/marc:subfield[@code='e'])</xpath>
        <from>callnumber</from>
        <table ref="callnumber" />
    </key>
    <table name="callnumber" id="10" type="callNumber1">
        <convert>
            <string style="upper" />
        </convert>
        <convertquery>
            <string style="upper" />
        </convertquery>
        <caption lang="zh">索取号</caption>
        <caption lang="en">Call number</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='905']/marc:subfield[@code='a']</xpath>
        <from>rightsHolder</from>
        <table ref="rightsHolder" />
    </key>
    <table name="rightsHolder" id="11">
        <convert>
            <string style="upper,simplify" />
        </convert>
        <convertquery>
            <string style="upper,simplify" />
        </convertquery>
        <caption lang="zh-cn">收藏单位</caption>
        <caption lang="en">Rights holder</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='905']/marc:subfield[@code='d']</xpath>
        <from>classnumber</from>
        <table ref="classnumber" />
    </key>
    <table name="classnumber" id="12" type="callnumber">
        <caption lang="zh">索取类号</caption>
        <caption lang="en">Class of call number</caption>
    </table>
    <key>
        <xpath nstable="">/marc:record/marc:datafield[@tag='998']/marc:subfield[@code='a']</xpath>
        <from>batchno</from>
        <table ref="batchno" />
    </key>
    <table name="batchno" id="13" type="batchno">
        <caption lang="zh">批次号</caption>
        <caption lang="en">Batch number</caption>
    </table>
    <!-- ******************配置非用字**************************************** -->
    <stopword>
        <stopwordTable name="title">
            <separator>
                <t>,</t>
                <t>_</t>
                <t> </t>
                <t>&amp;</t>
                <t>.</t>
                <t>:</t>
                <t>;</t>
                <t>!</t>
                <t>"</t>
                <t>'</t>
                <t>-</t>
                <t>&lt;</t>
                <t>&gt;</t>
                <t>-</t>
                <t>，</t>
                <t>。</t>
                <t>‘</t>
                <t>’</t>
                <t>“</t>
                <t>”</t>
                <t>—</t>
            </separator>
            <word>
                <t>the</t>
                <t>a</t>
            </word>
        </stopwordTable>
    </stopword>
    <script><![CDATA[

using System;
using System.Xml;
using DigitalPlatform.rms;
using DigitalPlatform.IO;

public class MyKeysHost : KeysHost
{

  public void convertISBN()
  {
       string isbn = this.InputString;
       isbn = isbn.Replace("-", "");   //去除ISBN中的"-"连接符号
       isbn = isbn.Replace("—", ""); //为稳妥，去除ISBN中的全角"—"连接符号
 
            if (isbn.Length < 3)
            {
                this.ResultString = isbn; //如果ISBN不足3位，原样输出
                return;
            }

            string head = isbn.Substring(0, 3);       //获得新旧ISBN号的判断依据

            if (head == "978")
            {
                isbn = isbn.Substring(3, isbn.Length - 3);
 
                if (isbn.Length >= 10)
                {
                    isbn = isbn.Substring(0, 9);
                }
            }
           else
           {
                if (isbn.Length >= 10)
                {
                           isbn = isbn.Substring(0, 9);                        
                }
           }

       this.ResultString = isbn;
//     this.ResultStrings.Add(isbn);        //如果同时构造出多索引，采用添加函数
  }

  public void convertISSN()
  {
       string issn = this.InputString;
       issn = issn.Replace("-", "");   //去除ISSN中的"-"连接符号
       issn = issn.Replace("—", ""); //为稳妥，去除ISSN中的全角"—"连接符号
 
            if (issn.Length < 3)
            {
                this.ResultString = issn; //如果ISSN不足3位，原样输出
                return;
            }

            string head = issn.Substring(0, 3);       //获得新旧ISSN号的判断依据

            if (head == "977")
                issn = issn.Substring(3, issn.Length - 3);


            if (issn.Length >= 8)
                issn = issn.Substring(0, 7);                       

       this.ResultString = issn;
  }

}

]]><refs><ref>system.dll</ref><ref>system.xml.dll</ref><ref>%bindir%\digitalplatform.xml.dll</ref><ref>%bindir%\digitalplatform.io.dll</ref></refs></script>
</root>