Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
authorDennis Schafroth <dennis@indexdata.com>
Fri, 12 Mar 2010 13:55:04 +0000 (14:55 +0100)
committerDennis Schafroth <dennis@indexdata.com>
Fri, 12 Mar 2010 13:55:04 +0000 (14:55 +0100)
20 files changed:
.cproject [new file with mode: 0644]
.project [new file with mode: 0644]
src/client.c
src/http_command.c
test/marc21.xsl
test/marc21_test.xsl [new file with mode: 0644]
test/run_pazpar2.sh
test/test_http.cfg
test/test_turbomarcxml.cfg [new file with mode: 0644]
test/test_turbomarcxml.sh [new file with mode: 0755]
test/test_turbomarcxml_1.res [new file with mode: 0644]
test/test_turbomarcxml_2.res [new file with mode: 0644]
test/test_turbomarcxml_3.res [new file with mode: 0644]
test/test_turbomarcxml_4.res [new file with mode: 0644]
test/test_turbomarcxml_5.res [new file with mode: 0644]
test/test_turbomarcxml_6.res [new file with mode: 0644]
test/test_turbomarcxml_7.res [new file with mode: 0644]
test/test_turbomarcxml_8.res [new file with mode: 0644]
test/test_turbomarcxml_urls [new file with mode: 0644]
test/tmarcxml.xsl [new file with mode: 0644]

diff --git a/.cproject b/.cproject
new file mode 100644 (file)
index 0000000..8b529e5
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,602 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+       <storageModule moduleId="org.eclipse.cdt.core.settings">
+               <cconfiguration id="cdt.managedbuild.config.gnu.macosx.exe.debug.1350738082">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.macosx.exe.debug.1350738082" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+                       <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.macosx.exe.debug.1350738082" name="Debug" parent="cdt.managedbuild.config.gnu.macosx.exe.debug">
+                                       <folderInfo id="cdt.managedbuild.config.gnu.macosx.exe.debug.1350738082." name="/" resourcePath="">
+                                               <toolChain id="cdt.managedbuild.toolchain.gnu.macosx.exe.debug.642779913" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.exe.debug">
+                                                       <targetPlatform id="cdt.managedbuild.target.gnu.platform.macosx.exe.debug.206052691" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.exe.debug"/>
+                                                       <builder buildPath="${workspace_loc:/pazpar2.master/Debug}" command="src/make" id="cdt.managedbuild.target.gnu.builder.macosx.exe.debug.2009339594" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.exe.debug"/>
+                                                       <tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.debug.937721886" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.debug">
+                                                               <inputType id="cdt.managedbuild.tool.macosx.c.linker.input.377427532" superClass="cdt.managedbuild.tool.macosx.c.linker.input">
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+                                                               </inputType>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.debug.301077445" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.debug"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.macosx.exe.debug.558303931" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.macosx.exe.debug">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1188834286" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.macosx.base.1147822956" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.macosx.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.debug.1794369284" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.debug">
+                                                               <option id="gnu.cpp.compilermacosx.exe.debug.option.optimization.level.1086120406" name="Optimization Level" superClass="gnu.cpp.compilermacosx.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+                                                               <option id="gnu.cpp.compiler.macosx.exe.debug.option.debugging.level.1239380339" name="Debug Level" superClass="gnu.cpp.compiler.macosx.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.debug.2080175189" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.debug">
+                                                               <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.macosx.exe.debug.option.optimization.level.1726497609" name="Optimization Level" superClass="gnu.c.compiler.macosx.exe.debug.option.optimization.level" valueType="enumerated"/>
+                                                               <option id="gnu.c.compiler.macosx.exe.debug.option.debugging.level.88106198" name="Debug Level" superClass="gnu.c.compiler.macosx.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1159745856" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+                                                       </tool>
+                                               </toolChain>
+                                       </folderInfo>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="scannerConfiguration">
+                               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="makefileGenerator">
+                                               <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.macosx.exe.debug.1350738082;cdt.managedbuild.config.gnu.macosx.exe.debug.1350738082.;cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.debug.2080175189;cdt.managedbuild.tool.gnu.c.compiler.input.1159745856">
+                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="makefileGenerator">
+                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                               </scannerConfigBuildInfo>
+                               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.macosx.exe.release.397760623;cdt.managedbuild.config.macosx.exe.release.397760623.;cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.release.479123096;cdt.managedbuild.tool.gnu.c.compiler.input.144338339">
+                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="makefileGenerator">
+                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                               </scannerConfigBuildInfo>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+                       <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
+               </cconfiguration>
+               <cconfiguration id="cdt.managedbuild.config.macosx.exe.release.397760623">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.macosx.exe.release.397760623" moduleId="org.eclipse.cdt.core.settings" name="Release">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+                       <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.macosx.exe.release.397760623" name="Release" parent="cdt.managedbuild.config.macosx.exe.release">
+                                       <folderInfo id="cdt.managedbuild.config.macosx.exe.release.397760623." name="/" resourcePath="">
+                                               <toolChain id="cdt.managedbuild.toolchain.gnu.macosx.exe.release.740147803" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.exe.release">
+                                                       <targetPlatform id="cdt.managedbuild.target.gnu.platform.macosx.exe.release.2059998902" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.exe.release"/>
+                                                       <builder buildPath="${workspace_loc:/pazpar2.master/Release}" id="cdt.managedbuild.target.gnu.builder.macosx.exe.release.893517025" managedBuildOn="true" name="Gnu Make Builder.Release" superClass="cdt.managedbuild.target.gnu.builder.macosx.exe.release"/>
+                                                       <tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.release.217097143" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.release">
+                                                               <inputType id="cdt.managedbuild.tool.macosx.c.linker.input.1144641815" superClass="cdt.managedbuild.tool.macosx.c.linker.input">
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+                                                               </inputType>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.release.80891690" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.release"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.macosx.exe.release.2095159044" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.macosx.exe.release">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.538196723" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.macosx.base.785295904" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.macosx.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release.1602863758" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release">
+                                                               <option id="gnu.cpp.compiler.macosx.exe.release.option.optimization.level.188273471" superClass="gnu.cpp.compiler.macosx.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+                                                               <option id="gnu.cpp.compiler.macosx.exe.release.option.debugging.level.1795172740" superClass="gnu.cpp.compiler.macosx.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.release.479123096" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.release">
+                                                               <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.macosx.exe.release.option.optimization.level.590469295" superClass="gnu.c.compiler.macosx.exe.release.option.optimization.level" valueType="enumerated"/>
+                                                               <option id="gnu.c.compiler.macosx.exe.release.option.debugging.level.1332521313" superClass="gnu.c.compiler.macosx.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.144338339" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+                                                       </tool>
+                                               </toolChain>
+                                       </folderInfo>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="scannerConfiguration">
+                               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="makefileGenerator">
+                                               <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+                                       <buildOutputProvider>
+                                               <openAction enabled="true" filePath=""/>
+                                               <parser enabled="true"/>
+                                       </buildOutputProvider>
+                                       <scannerInfoProvider id="specsFile">
+                                               <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+                                               <parser enabled="true"/>
+                                       </scannerInfoProvider>
+                               </profile>
+                               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.macosx.exe.debug.1350738082;cdt.managedbuild.config.gnu.macosx.exe.debug.1350738082.;cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.debug.2080175189;cdt.managedbuild.tool.gnu.c.compiler.input.1159745856">
+                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="makefileGenerator">
+                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                               </scannerConfigBuildInfo>
+                               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.macosx.exe.release.397760623;cdt.managedbuild.config.macosx.exe.release.397760623.;cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.release.479123096;cdt.managedbuild.tool.gnu.c.compiler.input.144338339">
+                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="makefileGenerator">
+                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+                                               <buildOutputProvider>
+                                                       <openAction enabled="true" filePath=""/>
+                                                       <parser enabled="true"/>
+                                               </buildOutputProvider>
+                                               <scannerInfoProvider id="specsFile">
+                                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
+                                                       <parser enabled="true"/>
+                                               </scannerInfoProvider>
+                                       </profile>
+                               </scannerConfigBuildInfo>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="pazpar2.master.cdt.managedbuild.target.macosx.exe.943143256" name="Executable" projectType="cdt.managedbuild.target.macosx.exe"/>
+       </storageModule>
+</cproject>
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..5398d34
--- /dev/null
+++ b/.project
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>pazpar2.master</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+                       <triggers>clean,full,incremental,</triggers>
+                       <arguments>
+                               <dictionary>
+                                       <key>?name?</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildArguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildCommand</key>
+                                       <value>src/make</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildLocation</key>
+                                       <value>${workspace_loc:/pazpar2.master/Debug}</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+                                       <value>clean</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.contents</key>
+                                       <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+                                       <value>false</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.stopOnError</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>false</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+       </natures>
+</projectDescription>
index 00e72d2..18d7c6b 100644 (file)
@@ -349,6 +349,11 @@ static int nativesyntax_to_type(struct session_database *sdb, char *type,
         {
             strcpy(type, "xml");
         }
+        else if (!strncmp(s, "txml", 4))
+        {
+            const char *cp = strchr(s, ';');
+            yaz_snprintf(type, 80, "txml; charset=%s", cp ? cp+1 : "marc-8s");
+        }
         else
             return -1;
         return 0;
@@ -363,6 +368,11 @@ static int nativesyntax_to_type(struct session_database *sdb, char *type,
                 strcpy(type, "xml");
                 return 0;
             }
+            else if (!strcmp(syntax, "TXML"))
+                {
+                    strcpy(type, "txml");
+                    return 0;
+                }
             else if (!strcmp(syntax, "USmarc") || !strcmp(syntax, "MARC21"))
             {
                 strcpy(type, "xml; charset=marc8-s");
index cf9be94..4800d22 100644 (file)
@@ -162,6 +162,10 @@ void http_session_destroy(struct http_session *s)
         destroy_session(s->psession);
         nmem_destroy(s->nmem);
     }
+    else {
+        yaz_log(YLOG_LOG, "Active clients on session %u. Waiting for new timeout.", s->session_id);
+    }
+
 }
 
 static const char *get_msg(enum pazpar2_error_code code)
index 8c8fcfb..71178b7 100644 (file)
@@ -4,16 +4,19 @@
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
     xmlns:marc="http://www.loc.gov/MARC21/slim">
-
-    <xsl:param name="test"/>
   
   <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
 
 <!-- Extract metadata from MARC21/USMARC 
       http://www.loc.gov/marc/bibliographic/ecbdhome.html
 -->  
-  
-  <xsl:template match="/marc:record">
+  <xsl:template name="record-hook"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="marc:record">
     <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
     <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
     <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
@@ -22,7 +25,7 @@
     <xsl:variable name="medium">
       <xsl:choose>
        <xsl:when test="$title_medium">
-         <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
+         <xsl:value-of select="translate($title_medium, ' []/', '')"/>
        </xsl:when>
        <xsl:when test="$fulltext_a">
          <xsl:text>electronic resource</xsl:text>
@@ -30,9 +33,6 @@
        <xsl:when test="$fulltext_b">
          <xsl:text>electronic resource</xsl:text>
        </xsl:when>
-       <xsl:when test="$electronic_location_url">
-         <xsl:text>electronic resource</xsl:text>
-       </xsl:when>
        <xsl:when test="$journal_title">
          <xsl:text>article</xsl:text>
        </xsl:when>
     </xsl:variable>
 
     <pz:record>
-      <xsl:attribute name="mergekey">
-        <xsl:text>title </xsl:text>
-       <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
-       <xsl:text> author </xsl:text>
-       <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
-       <xsl:text> medium </xsl:text>
-       <xsl:value-of select="$medium"/>
-      </xsl:attribute>
-
-      <pz:metadata type="test-usersetting-2">
-        test-usersetting-2 data: 
-        <xsl:value-of select="$test"/>
-      </pz:metadata>
-
+      
       <xsl:for-each select="marc:controlfield[@tag='001']">
         <pz:metadata type="id">
           <xsl:value-of select="."/>
        </pz:metadata>
       </xsl:for-each>
 
+      <xsl:for-each select="marc:datafield[@tag='035']">
+        <pz:metadata type="system-control-nr">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
       <xsl:for-each select="marc:datafield[@tag='100']">
        <pz:metadata type="author">
          <xsl:value-of select="marc:subfield[@code='a']"/>
         <pz:metadata type="title-medium">
           <xsl:value-of select="marc:subfield[@code='h']"/>
         </pz:metadata>
+        <pz:metadata type="title-number-section">
+          <xsl:value-of select="marc:subfield[@code='n']"/>
+        </pz:metadata>
       </xsl:for-each>
 
       <xsl:for-each select="marc:datafield[@tag='250']">
        </pz:metadata>
       </xsl:for-each>
 
-      <xsl:for-each select="marc:datafield[@tag &gt;= 500 and @tag &lt;= 599]
-                           [@tag != '506' and @tag != '530' and
-                           @tag != '540' and @tag != '546'
-                            and @tag != '522']">
-        <!-- The tag attribute below will be preserved -->
-       <pz:metadata type="description" tag="{@tag}">
+      <xsl:for-each select="marc:datafield[@tag = '500' or @tag = '505' or
+               @tag = '518' or @tag = '520' or @tag = '522']">
+       <pz:metadata type="description">
             <xsl:value-of select="*/text()"/>
         </pz:metadata>
       </xsl:for-each>
       
-      <xsl:for-each select="marc:datafield[@tag='650' or @tag='653']">
-       <pz:metadata type="subject">
+      <xsl:for-each select="marc:datafield[@tag='600' or @tag='610' or @tag='611' or @tag='630' or @tag='648' or @tag='650' or @tag='651' or @tag='653' or @tag='654' or @tag='655' or @tag='656' or @tag='657' or @tag='658' or @tag='662' or @tag='69X']">
+        <pz:metadata type="subject">
          <xsl:value-of select="marc:subfield[@code='a']"/>
        </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="marc:subfield">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
       </xsl:for-each>
 
       <xsl:for-each select="marc:datafield[@tag='856']">
          <xsl:value-of select="marc:subfield[@code='u']"/>
        </pz:metadata>
        <pz:metadata type="electronic-text">
-         <xsl:value-of select="marc:subfield[@code='y']"/>
+         <xsl:value-of select="marc:subfield[@code='y' or @code='3']"/>
        </pz:metadata>
        <pz:metadata type="electronic-note">
          <xsl:value-of select="marc:subfield[@code='z']"/>
        </pz:metadata>
+       <pz:metadata type="electronic-format-instruction">
+         <xsl:value-of select="marc:subfield[@code='i']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-format-type">
+         <xsl:value-of select="marc:subfield[@code='q']"/>
+       </pz:metadata>
       </xsl:for-each>
 
       <xsl:for-each select="marc:datafield[@tag='773']">
-       <pz:metadata type="citation">
-         <xsl:for-each select="*">
-           <xsl:value-of select="normalize-space(.)"/>
-           <xsl:text> </xsl:text>
-         </xsl:for-each>
-       </pz:metadata>
+       <pz:metadata type="citation">
+             <xsl:for-each select="*">
+               <xsl:value-of select="normalize-space(.)"/>
+               <xsl:text> </xsl:text>
+         </xsl:for-each>
+        </pz:metadata>
+        <xsl:if test="marc:subfield[@code='t']">
+         <pz:metadata type="journal-title">
+               <xsl:value-of select="marc:subfield[@code='t']"/>
+          </pz:metadata>          
+        </xsl:if>
+        <xsl:if test="marc:subfield[@code='g']">
+         <pz:metadata type="journal-subpart">
+               <xsl:value-of select="marc:subfield[@code='g']"/>
+          </pz:metadata>          
+        </xsl:if>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='852']">
+        <xsl:if test="marc:subfield[@code='y']">
+         <pz:metadata type="publicnote">
+           <xsl:value-of select="marc:subfield[@code='y']"/>
+         </pz:metadata>
+       </xsl:if>
+       <xsl:if test="marc:subfield[@code='h']">
+         <pz:metadata type="callnumber">
+           <xsl:value-of select="marc:subfield[@code='h']"/>
+         </pz:metadata>
+       </xsl:if>
       </xsl:for-each>
 
       <pz:metadata type="medium">
        <xsl:value-of select="$medium"/>
       </pz:metadata>
       
-      <xsl:if test="$fulltext_a">
+      <xsl:for-each select="marc:datafield[@tag='900']/marc:subfield[@code='a']">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- <xsl:if test="$fulltext_a">
        <pz:metadata type="fulltext">
          <xsl:value-of select="$fulltext_a"/>
        </pz:metadata>
-      </xsl:if>
+      </xsl:if> -->
 
-      <xsl:if test="$fulltext_b">
+      <xsl:for-each select="marc:datafield[@tag='900']/marc:subfield[@code='b']">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- <xsl:if test="$fulltext_b">
        <pz:metadata type="fulltext">
          <xsl:value-of select="$fulltext_b"/>
        </pz:metadata>
-      </xsl:if>
-    </pz:record>
+      </xsl:if> -->
+
+      <xsl:for-each select="marc:datafield[@tag='907' or @tag='901']">
+        <pz:metadata type="iii-id">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='926']">
+        <pz:metadata type="holding">
+         <xsl:for-each select="marc:subfield">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='948']">
+        <pz:metadata type="holding">
+         <xsl:for-each select="marc:subfield">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='991']">
+        <pz:metadata type="holding">
+         <xsl:for-each select="marc:subfield">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- passthrough id data -->
+      <xsl:for-each select="pz:metadata">
+          <xsl:copy-of select="."/>
+      </xsl:for-each>
+
+      <!-- other stylesheets importing this might want to define this -->
+      <xsl:call-template name="record-hook"/>
+
+    </pz:record>    
   </xsl:template>
+  
+  <xsl:template match="text()"/>
 
 </xsl:stylesheet>
diff --git a/test/marc21_test.xsl b/test/marc21_test.xsl
new file mode 100644 (file)
index 0000000..38c1d38
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim">
+
+    <xsl:param name="test"/>
+  
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+<!-- Extract metadata from MARC21/USMARC 
+      http://www.loc.gov/marc/bibliographic/ecbdhome.html
+-->  
+  
+  <xsl:template match="marc:record">
+    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
+    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
+    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
+    <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
+    <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
+    <xsl:variable name="medium">
+      <xsl:choose>
+       <xsl:when test="$title_medium">
+         <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
+       </xsl:when>
+       <xsl:when test="$fulltext_a">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$fulltext_b">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$electronic_location_url">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$journal_title">
+         <xsl:text>article</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:text>book</xsl:text>
+       </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <pz:record>
+      <xsl:attribute name="mergekey">
+        <xsl:text>title </xsl:text>
+       <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
+       <xsl:text> author </xsl:text>
+       <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
+       <xsl:text> medium </xsl:text>
+       <xsl:value-of select="$medium"/>
+      </xsl:attribute>
+
+      <pz:metadata type="test-usersetting-2">
+        test-usersetting-2 data: 
+        <xsl:value-of select="$test"/>
+      </pz:metadata>
+
+      <xsl:for-each select="marc:controlfield[@tag='001']">
+        <pz:metadata type="id">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='010']">
+        <pz:metadata type="lccn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='020']">
+        <pz:metadata type="isbn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='022']">
+        <pz:metadata type="issn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='027']">
+        <pz:metadata type="tech-rep-nr">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='100']">
+       <pz:metadata type="author">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="author-title">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="author-date">
+         <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='110']">
+       <pz:metadata type="corporate-name">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-location">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-date">
+           <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='111']">
+       <pz:metadata type="meeting-name">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-location">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-date">
+           <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='260']">
+       <pz:metadata type="date">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='245']">
+        <pz:metadata type="title">
+          <xsl:value-of select="marc:subfield[@code='a']"/>
+        </pz:metadata>
+        <pz:metadata type="title-remainder">
+          <xsl:value-of select="marc:subfield[@code='b']"/>
+        </pz:metadata>
+        <pz:metadata type="title-responsibility">
+          <xsl:value-of select="marc:subfield[@code='c']"/>
+        </pz:metadata>
+        <pz:metadata type="title-dates">
+          <xsl:value-of select="marc:subfield[@code='f']"/>
+        </pz:metadata>
+        <pz:metadata type="title-medium">
+          <xsl:value-of select="marc:subfield[@code='h']"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='250']">
+       <pz:metadata type="edition">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='260']">
+        <pz:metadata type="publication-place">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+        <pz:metadata type="publication-name">
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+        <pz:metadata type="publication-date">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='300']">
+       <pz:metadata type="physical-extent">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-format">
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-dimensions">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-accomp">
+         <xsl:value-of select="marc:subfield[@code='e']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unittype">
+         <xsl:value-of select="marc:subfield[@code='f']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unitsize">
+         <xsl:value-of select="marc:subfield[@code='g']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-specified">
+         <xsl:value-of select="marc:subfield[@code='3']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='440']">
+       <pz:metadata type="series-title">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag &gt;= 500 and @tag &lt;= 599]
+                           [@tag != '506' and @tag != '530' and
+                           @tag != '540' and @tag != '546'
+                            and @tag != '522']">
+        <!-- The tag attribute below will be preserved -->
+       <pz:metadata type="description" tag="{@tag}">
+            <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+      
+      <xsl:for-each select="marc:datafield[@tag='650' or @tag='653']">
+       <pz:metadata type="subject">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='856']">
+       <pz:metadata type="electronic-url">
+         <xsl:value-of select="marc:subfield[@code='u']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-text">
+         <xsl:value-of select="marc:subfield[@code='y']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-note">
+         <xsl:value-of select="marc:subfield[@code='z']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='773']">
+       <pz:metadata type="citation">
+         <xsl:for-each select="*">
+           <xsl:value-of select="normalize-space(.)"/>
+           <xsl:text> </xsl:text>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <pz:metadata type="medium">
+       <xsl:value-of select="$medium"/>
+      </pz:metadata>
+      
+      <xsl:if test="$fulltext_a">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_a"/>
+       </pz:metadata>
+      </xsl:if>
+
+      <xsl:if test="$fulltext_b">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_b"/>
+       </pz:metadata>
+      </xsl:if>
+    </pz:record>
+  </xsl:template>
+
+</xsl:stylesheet>
index fd3cf49..05112d7 100755 (executable)
@@ -28,20 +28,24 @@ fi
 GET='$curl --silent --output $OUT2 "$f"'
 POST='$curl --silent --header "Content-Type: text/xml" --data-binary "@$postfile" --output $OUT2  "$f"'
 
+if [ -z "$SKIP_PAZPAR2" ] ; then
 # Fire up pazpar2
-rm -f pazpar2.log
-
+    rm -f pazpar2.log
+fi
 PREFIX=$1
 if test "x${PREFIX}" = "x"; then
     echo Missing prefix for run_pazpar2.sh
     exit 1
 fi
+
 CFG=${PREFIX}.cfg
 URLS=${PREFIX}_urls
 VALGRINDLOG=${PREFIX}_valgrind.log
 
 if test -n "$PAZPAR2_USE_VALGRIND"; then
     valgrind --leak-check=full --log-file=$VALGRINDLOG ../src/pazpar2 -X -l pazpar2.log -f ${CFG} >extra_pazpar2.log 2>&1 &
+elif test -n "$SKIP_PAZPAR2"; then 
+    echo "Skipping pazpar2. Must already be running with correct config!!! " 
 else
     YAZ_LOG=zoom,zoomdetails,debug,log,fatal ../src/pazpar2 -d -X -l pazpar2.log -f ${srcdir}/${CFG} >extra_pazpar2.log 2>&1 &
 fi
@@ -55,12 +59,14 @@ sleep 3
 # Set to success by default.. Will be set to non-zero in case of failure
 code=0
 
-if ps -p $PP2PID >/dev/null 2>&1; then
-    :
-else
-    code=1
-    PP2PID=""
-    echo "pazpar2 failed to start"
+if [ -z "$SKIP_PAZPAR2" ] ; then 
+    if ps -p $PP2PID >/dev/null 2>&1; then
+       :
+    else
+       code=1
+       PP2PID=""
+       echo "pazpar2 failed to start"
+    fi
 fi
 
 # We can start test for real
@@ -105,20 +111,24 @@ for f in `cat ${srcdir}/${URLS}`; do
            code=1
        fi
     fi
-    if ps -p $PP2PID >/dev/null 2>&1; then
-       :
-    else
-       IFS="$oIFS"
-       echo "Test $testno: pazpar2 died"
-       exit 1
+    if [ -z "$SKIP_PAZPAR2" ] ; then  
+       if ps -p $PP2PID >/dev/null 2>&1; then
+           :
+       else
+           IFS="$oIFS"
+           echo "Test $testno: pazpar2 died"
+           exit 1
+       fi
     fi
 done
 
 # Kill programs
 
-if test -n "$PP2PID"; then
-    kill $PP2PID
-    sleep 2
+if [ -z "$SKIP_PAZPAR2" ] ; then 
+    if test -n "$PP2PID"; then
+       kill $PP2PID
+       sleep 2
+    fi
 fi
 
 exit $code
index 271efe9..65287b7 100644 (file)
@@ -9,12 +9,12 @@
       <include src="z3950_indexdata_com_marc.xml"/>
       <targetprofiles type="local" src="../zeerex/records/"/>
       <metadata name="url" merge="unique"/>
-      <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6"/>
+      <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6" mergekey="required" />
       <metadata name="title-remainder" brief="yes" merge="longest" rank="5"/>
       <metadata name="isbn"/>
       <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
                termlist="yes"/>
-      <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2"/>
+      <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2" mergekey="optional" />
       <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
       <metadata name="id"/>
       <metadata name="lccn" merge="unique"/>
diff --git a/test/test_turbomarcxml.cfg b/test/test_turbomarcxml.cfg
new file mode 100644 (file)
index 0000000..65287b7
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
+  <!-- Used by test_http.sh -->
+  <server>
+    <listen port="9763"/>
+    <proxy host="localhost"/>
+    
+    <service>
+      <include src="z3950_indexdata_com_marc.xml"/>
+      <targetprofiles type="local" src="../zeerex/records/"/>
+      <metadata name="url" merge="unique"/>
+      <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6" mergekey="required" />
+      <metadata name="title-remainder" brief="yes" merge="longest" rank="5"/>
+      <metadata name="isbn"/>
+      <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
+               termlist="yes"/>
+      <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2" mergekey="optional" />
+      <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
+      <metadata name="id"/>
+      <metadata name="lccn" merge="unique"/>
+      <metadata name="description" brief="yes" merge="longest" rank="3"/>
+      
+      <metadata name="test-usersetting" brief="yes" setting="postproc"/>
+      <metadata name="test" setting="parameter"/>
+      <metadata name="test-usersetting-2" brief="yes"/>
+    </service>
+
+    <include src="*_service.xml"/> 
+    <include src="no_such_service.xml"/>
+
+  </server>
+  
+  
+</pazpar2>
+<!-- Keep this comment at the end of the file
+     Local variables:
+     mode: nxml
+     End:
+-->
diff --git a/test/test_turbomarcxml.sh b/test/test_turbomarcxml.sh
new file mode 100755 (executable)
index 0000000..524bd55
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+
+# srcdir might be set by make
+srcdir=${srcdir:-"."}
+
+# Test using test_http.cfg
+exec ${srcdir}/run_pazpar2.sh test_turbomarcxml
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
diff --git a/test/test_turbomarcxml_1.res b/test/test_turbomarcxml_1.res
new file mode 100644 (file)
index 0000000..81ff9ff
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<init><status>OK</status><session>1</session><protocol>1</protocol></init>
\ No newline at end of file
diff --git a/test/test_turbomarcxml_2.res b/test/test_turbomarcxml_2.res
new file mode 100644 (file)
index 0000000..42534e3
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_turbomarcxml_3.res b/test/test_turbomarcxml_3.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_turbomarcxml_4.res b/test/test_turbomarcxml_4.res
new file mode 100644 (file)
index 0000000..5983cd5
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show>
+<status>OK</status>
+<activeclients>0</activeclients>
+<merged>3</merged>
+<total>3</total>
+<start>0</start>
+<num>3</num>
+<hit>
+
+<md-title>BIBLIOGRAPHY OF MAINE GEOLOGY</md-title>
+<md-description>This data base is a computer based bibliography of marine geology.  It allows 
+searching by topic and geographic location, similar to GEOREF.  It is currently 
+under development to replace the printed Bibliography of Marine Geology</md-description><location id="z3950.indexdata.com/gils" name="gils">
+<md-title>BIBLIOGRAPHY OF MAINE GEOLOGY</md-title>
+<md-description>This data base is a computer based bibliography of marine geology.  It allows 
+searching by topic and geographic location, similar to GEOREF.  It is currently 
+under development to replace the printed Bibliography of Marine Geology</md-description></location>
+<relevance>9416</relevance>
+<recid>title bibliography of maine geology</recid>
+</hit>
+<hit>
+
+<md-title>GROUNDWATER RESOURCE MAPS - COUNTY SERIES</md-title>
+<md-description>A series of 1:250,000 scale maps showing well yield, well depth, and depth to 
+bedrock for a large number of bedrock wells inventoried by the Maine Geological 
+Survey in the mid-to late 1970&apos;s comprises this data set.  Some series also 
+show bedrock topography and potentiometric surface.  Geographic coverage is 
+restricted to Southern Maine</md-description><location id="z3950.indexdata.com/gils" name="gils">
+<md-title>GROUNDWATER RESOURCE MAPS - COUNTY SERIES</md-title>
+<md-description>A series of 1:250,000 scale maps showing well yield, well depth, and depth to 
+bedrock for a large number of bedrock wells inventoried by the Maine Geological 
+Survey in the mid-to late 1970&apos;s comprises this data set.  Some series also 
+show bedrock topography and potentiometric surface.  Geographic coverage is 
+restricted to Southern Maine</md-description></location>
+<relevance>0</relevance>
+<recid>title groundwater resource maps county series</recid>
+</hit>
+<hit>
+
+<md-title>OIL/GAS DRILLING</md-title>
+<md-description>This database contains information on oil and gas drilling such as well name, 
+operator, driller, location, depth, copies of logs run, permits, samples 
+(cuttings, core), completion records</md-description><location id="z3950.indexdata.com/gils" name="gils">
+<md-title>OIL/GAS DRILLING</md-title>
+<md-description>This database contains information on oil and gas drilling such as well name, 
+operator, driller, location, depth, copies of logs run, permits, samples 
+(cuttings, core), completion records</md-description></location>
+<relevance>0</relevance>
+<recid>title oil gas drilling</recid>
+</hit>
+</show>
diff --git a/test/test_turbomarcxml_5.res b/test/test_turbomarcxml_5.res
new file mode 100644 (file)
index 0000000..42534e3
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_turbomarcxml_6.res b/test/test_turbomarcxml_6.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_turbomarcxml_7.res b/test/test_turbomarcxml_7.res
new file mode 100644 (file)
index 0000000..c0aa569
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show>
+<status>OK</status>
+<activeclients>0</activeclients>
+<merged>3</merged>
+<total>3</total>
+<start>0</start>
+<num>3</num>
+<hit>
+<location id="z3950.indexdata.com/gils" name="gils"></location>
+<relevance>0</relevance>
+<recid>z3950.indexdata.com/gils-1</recid>
+</hit>
+<hit>
+<location id="z3950.indexdata.com/gils" name="gils"></location>
+<relevance>0</relevance>
+<recid>z3950.indexdata.com/gils-2</recid>
+</hit>
+<hit>
+<location id="z3950.indexdata.com/gils" name="gils"></location>
+<relevance>0</relevance>
+<recid>z3950.indexdata.com/gils-3</recid>
+</hit>
+</show>
diff --git a/test/test_turbomarcxml_8.res b/test/test_turbomarcxml_8.res
new file mode 100644 (file)
index 0000000..76e330a
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>z3950.indexdata.com/gils</id>
+<name>gils</name>
+<hits>3</hits>
+<diagnostic>0</diagnostic>
+<records>3</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
diff --git a/test/test_turbomarcxml_urls b/test/test_turbomarcxml_urls
new file mode 100644 (file)
index 0000000..4eb22a6
--- /dev/null
@@ -0,0 +1,8 @@
+http://localhost:9763/search.pz2?command=init&clear=1
+http://localhost:9763/search.pz2?session=1&command=settings&pz:name%5Bz3950.indexdata.com%2Fgils%5D=gils&pz:requestsyntax%5Bz3950.indexdata.com%2Fgils%5D=usmarc&pz:nativesyntax%5Bz3950.indexdata.com%2Fgils%5D=xml&pz:xslt%5Bz3950.indexdata.com%2Fgils%5D=marc21.xsl
+http://localhost:9763/search.pz2?session=1&command=search&query=computer
+2 http://localhost:9763/search.pz2?session=1&command=show&block=1
+http://localhost:9763/search.pz2?session=1&command=settings&pz:name%5Bz3950.indexdata.com%2Fgils%5D=gils&pz:requestsyntax%5Bz3950.indexdata.com%2Fgils%5D=usmarc&pz:nativesyntax%5Bz3950.indexdata.com%2Fgils%5D=txml&pz:xslt%5Bz3950.indexdata.com%2Fgils%5D=tmarcxml.xsl
+http://localhost:9763/search.pz2?session=1&command=search&query=computer
+2 http://localhost:9763/search.pz2?session=1&command=show&block=1
+2 http://localhost:9763/search.pz2?session=1&command=bytarget
diff --git a/test/tmarcxml.xsl b/test/tmarcxml.xsl
new file mode 100644 (file)
index 0000000..0298792
--- /dev/null
@@ -0,0 +1,836 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:tmarc="http://www.indexdata.com/MARC21/turboxml" >
+  
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+<!-- 
+     Extract metadata from MARC21/USMARC from streamlined marcxml format
+      http://www.loc.gov/marc/bibliographic/ecbdhome.html
+-->  
+  <xsl:template name="record-hook"/>
+
+
+  <xsl:template match="/">
+    <pz:collection>
+     <xsl:apply-templates/>
+    </pz:collection>
+  </xsl:template>
+
+  <xsl:template match="tmarc:record">
+    <xsl:variable name="title_medium" select="tmarc:d245/tmarc:sh"/>
+    <xsl:variable name="journal_title" select="tmarc:d773/tmarc:st"/>
+    <xsl:variable name="electronic_location_url" select="tmarc:d856/tmarc:su"/>
+    <xsl:variable name="fulltext_a" select="tmarc:d900/tmarc:sa"/>
+    <xsl:variable name="fulltext_b" select="tmarc:d900/tmarc:sb"/>
+       <!-- Does not always hit the right substring. The field is not always fixed-width? -->
+    <xsl:variable name="control_lang" select="substring(tmarc:c008, 36, 3)"/>
+    <xsl:variable name="contains110" select="tmarc:d110"/>
+    <xsl:variable name="hasAuthorFields" select="tmarc:d100 or tmarc:d111"/>
+    
+    <xsl:variable name="medium">
+       <xsl:choose>
+               <xsl:when test="$title_medium">
+                       <xsl:value-of select="translate($title_medium, ' []/', '')" />
+               </xsl:when>
+               <xsl:when test="$fulltext_a">
+                       <xsl:text>electronic resource</xsl:text>
+               </xsl:when>
+               <xsl:when test="$fulltext_b">
+                       <xsl:text>electronic resource</xsl:text>
+               </xsl:when>
+               <xsl:when test="$journal_title">
+                       <xsl:text>article</xsl:text>
+               </xsl:when>
+               <xsl:otherwise>
+                       <xsl:text>book</xsl:text>
+               </xsl:otherwise>
+       </xsl:choose>
+    </xsl:variable>
+
+    <pz:record>
+       <xsl:attribute name="mergekey">
+        <xsl:text>title </xsl:text>
+       <xsl:value-of select="tmarc:d245/tmarc:sa" />
+       <xsl:text> author </xsl:text>
+       <xsl:value-of select="tmarc:d100/tmarc:sa" />
+       <xsl:text> medium </xsl:text>
+       <xsl:value-of select="$medium" />
+      </xsl:attribute>
+
+      <xsl:for-each select="tmarc:c001">
+        <pz:metadata type="id">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d010">
+        <pz:metadata type="lccn">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d020">
+        <pz:metadata type="isbn">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d022">
+        <pz:metadata type="issn">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d027">
+        <pz:metadata type="tech-rep-nr">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d035">
+        <pz:metadata type="system-control-nr">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d100">
+       <pz:metadata type="author">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="author-title">
+         <xsl:value-of select="tmarc:sc"/>
+       </pz:metadata>
+       <pz:metadata type="author-date">
+         <xsl:value-of select="tmarc:sd"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d110">
+       <pz:metadata type="corporate-name">
+           <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-location">
+           <xsl:value-of select="tmarc:sc"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-date">
+           <xsl:value-of select="tmarc:sd"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d111">
+       <pz:metadata type="meeting-name">
+           <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-location">
+           <xsl:value-of select="tmarc:sc"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-date">
+           <xsl:value-of select="tmarc:sd"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d260">
+       <pz:metadata type="date">
+           <xsl:value-of select="tmarc:sc"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d130">
+        <pz:metadata type="title-uniform">
+          <xsl:value-of select="tmarc:sa"/>
+        </pz:metadata>
+        <pz:metadata type="title-uniform-media">
+          <xsl:value-of select="tmarc:sm"/>
+        </pz:metadata>
+        <pz:metadata type="title-uniform-parts">
+          <xsl:value-of select="tmarc:sn"/>
+        </pz:metadata>
+        <pz:metadata type="title-uniform-partname">
+          <xsl:value-of select="tmarc:sp"/>
+        </pz:metadata>
+        <pz:metadata type="title-uniform-key">
+          <xsl:value-of select="tmarc:sr"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d245">
+        <pz:metadata type="title">
+          <xsl:value-of select="tmarc:sa"/>
+        </pz:metadata>
+        <pz:metadata type="title-remainder">
+          <xsl:value-of select="tmarc:sb"/>
+        </pz:metadata>
+        <pz:metadata type="title-responsibility">
+          <xsl:value-of select="tmarc:sc"/>
+        </pz:metadata>
+        <pz:metadata type="title-dates">
+          <xsl:value-of select="tmarc:sf"/>
+        </pz:metadata>
+        <pz:metadata type="title-medium">
+          <xsl:value-of select="tmarc:sh"/>
+        </pz:metadata>
+        <pz:metadata type="title-number-section">
+          <xsl:value-of select="tmarc:sn"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d250">
+       <pz:metadata type="edition">
+           <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d260">
+        <pz:metadata type="publication-place">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+        <pz:metadata type="publication-name">
+         <xsl:value-of select="tmarc:sb"/>
+       </pz:metadata>
+        <pz:metadata type="publication-date">
+         <xsl:value-of select="tmarc:sc"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d300">
+       <pz:metadata type="physical-extent">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="physical-format">
+         <xsl:value-of select="tmarc:sb"/>
+       </pz:metadata>
+       <pz:metadata type="physical-dimensions">
+         <xsl:value-of select="tmarc:sc"/>
+       </pz:metadata>
+       <pz:metadata type="physical-accomp">
+         <xsl:value-of select="tmarc:se"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unittype">
+         <xsl:value-of select="tmarc:sf"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unitsize">
+         <xsl:value-of select="tmarc:sg"/>
+       </pz:metadata>
+       <pz:metadata type="physical-specified">
+         <xsl:value-of select="tmarc:s3"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d440">
+       <pz:metadata type="series-title">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d500">
+       <pz:metadata type="description">
+          <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d505">
+       <pz:metadata type="description">
+          <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d518">
+       <pz:metadata type="description">
+          <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d520">
+       <pz:metadata type="description">
+          <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d522">
+       <pz:metadata type="description">
+          <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d600" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d610" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d611" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d630" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d648" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d650" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d651" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d653" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d654" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d655" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d656" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d657" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d658" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d662" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d69X" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+<!--
+     or tmarc:d651 or tmarc:d653 or tmarc:d654 or tmarc:d655 or tmarc:d656 or tmarc:d657 or tmarc:d658 or tmarc:d662 or tmarc:d69X">
+-->
+
+<!--
+      <xsl:for-each select="tmarc:d600" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="tmarc:sa tmarc:sb tmarc:sc tmarc:sd ">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+-->
+
+      <xsl:for-each select="tmarc:d856">
+       <pz:metadata type="electronic-url">
+         <xsl:value-of select="tmarc:su"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-text">
+         <xsl:if test="tmarc:sy" >
+           <xsl:value-of select="tmarc:sy/text()" />
+         </xsl:if>
+         <xsl:if test="tmarc:s3">
+           <xsl:value-of select="tmarc:s3/text()" />
+         </xsl:if>
+       </pz:metadata>
+       <pz:metadata type="electronic-note">
+         <xsl:value-of select="tmarc:sz"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-format-instruction">
+         <xsl:value-of select="tmarc:si"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-format-type">
+         <xsl:value-of select="tmarc:sq"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d773">
+       <pz:metadata type="citation">
+         <xsl:for-each select="*">
+           <xsl:value-of select="normalize-space(.)"/>
+           <xsl:text> </xsl:text>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d852">
+        <xsl:if test="tmarc:sy">
+         <pz:metadata type="publicnote">
+           <xsl:value-of select="tmarc:sy"/>
+         </pz:metadata>
+       </xsl:if>
+       <xsl:if test="tmarc:sh">
+         <pz:metadata type="callnumber">
+           <xsl:value-of select="tmarc:sh"/>
+         </pz:metadata>
+       </xsl:if>
+      </xsl:for-each>
+
+      <pz:metadata type="medium">
+       <xsl:value-of select="$medium"/>
+      </pz:metadata>
+      
+      <xsl:for-each select="tmarc:d900/tmarc:sa">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- <xsl:if test="$fulltext_a">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_a"/>
+       </pz:metadata>
+      </xsl:if>
+-->
+
+      <xsl:for-each select="tmarc:d900/tmarc:sb">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- <xsl:if test="$fulltext_b">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_b"/>
+       </pz:metadata>
+      </xsl:if>
+-->
+
+      <xsl:for-each select="tmarc:d907">
+<!--  or tmarc:d901"> -->
+        <pz:metadata type="iii-id">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d926">
+        <pz:metadata type="holding">
+         <xsl:for-each select="tmarc:s">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d948">
+        <pz:metadata type="holding">
+         <xsl:for-each select="tmarc:s">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d991">
+        <pz:metadata type="holding">
+         <xsl:for-each select="tmarc:s">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+       <pz:metadata tag="tag100">
+               <xsl:call-template name="shortTitle">
+                       <xsl:with-param name="tag" select="100" />
+               </xsl:call-template>
+       </pz:metadata>
+
+       <!-- Stuff for FRBR workset key -->
+       <xsl:variable name="title130">
+               <xsl:for-each select="tmarc:d130" >
+               <xsl:value-of select="tmarc:sa" />
+                       <xsl:value-of select="tmarc:sm" />
+                       <xsl:value-of select="tmarc:sn" />
+               <xsl:value-of select="tmarc:sp" />      
+               <xsl:value-of select="tmarc:sr" />
+               </xsl:for-each>         
+       </xsl:variable>
+
+       <xsl:variable name="title240">
+               <xsl:for-each select="tmarc:d240" >
+                       <xsl:value-of select="tmarc:sa" />
+                               <xsl:value-of select="tmarc:sm" />
+                   <xsl:value-of select="tmarc:sn" />
+                   <xsl:value-of select="tmarc:sp" />  
+                   <xsl:value-of select="tmarc:sr" />
+               </xsl:for-each>         
+       </xsl:variable>
+       <xsl:variable name="title242">
+               <xsl:for-each select="tmarc:d242" >
+                               <xsl:value-of select="tmarc:sa" />
+                               <xsl:if test="$contains110 and not($hasAuthorFields)">
+                                       <xsl:value-of select="tmarc:sb" />
+                       <xsl:value-of select="tmarc:sf" />
+                           <xsl:value-of select="tmarc:sg" />  
+                       <xsl:value-of select="tmarc:sn" />
+                       <xsl:value-of select="tmarc:sp" />
+                               </xsl:if>
+               </xsl:for-each>         
+       </xsl:variable>
+       <xsl:variable name="title242-full">
+               <xsl:for-each select="tmarc:d242" >
+                               <xsl:value-of select="tmarc:sa" />
+                               <xsl:value-of select="tmarc:sb" />
+               <xsl:value-of select="tmarc:sf" />
+                   <xsl:value-of select="tmarc:sg" />  
+               <xsl:value-of select="tmarc:sn" />
+               <xsl:value-of select="tmarc:sp" />
+               </xsl:for-each>         
+       </xsl:variable>
+
+       <xsl:variable name="title245">
+               <xsl:for-each select="tmarc:d245" >
+                               <xsl:value-of select="tmarc:sa" />
+                               <xsl:if test="$contains110 and not($hasAuthorFields)">
+                                       <xsl:value-of select="tmarc:sb" />
+                       <xsl:value-of select="tmarc:sf" />
+                           <xsl:value-of select="tmarc:sg" />  
+                       <xsl:value-of select="tmarc:sn" />
+                       <xsl:value-of select="tmarc:sp" />
+                               </xsl:if>
+               </xsl:for-each>         
+       </xsl:variable>
+       <xsl:variable name="title245-full">
+               <xsl:for-each select="tmarc:d245" >
+                       <xsl:value-of select="tmarc:sa" />
+                       <xsl:value-of select="tmarc:sb" />
+               <xsl:value-of select="tmarc:sf" />
+                   <xsl:value-of select="tmarc:sg" />  
+               <xsl:value-of select="tmarc:sn" />
+               <xsl:value-of select="tmarc:sp" />
+               </xsl:for-each>         
+       </xsl:variable>
+
+       <xsl:variable name="title246">
+               <xsl:for-each select="tmarc:d246" >
+                       <xsl:value-of select="tmarc:sa" />
+                       <xsl:if test="$contains110 and not($hasAuthorFields)">
+                               <xsl:value-of select="tmarc:sb" />
+               <xsl:value-of select="tmarc:sf" />
+                   <xsl:value-of select="tmarc:sg" />  
+               <xsl:value-of select="tmarc:sn" />
+               <xsl:value-of select="tmarc:sp" />
+                       </xsl:if>
+               </xsl:for-each>         
+       </xsl:variable>
+       <xsl:variable name="title246-full">
+               <xsl:for-each select="tmarc:d246" >
+                       <xsl:value-of select="tmarc:sa" />
+                       <xsl:value-of select="tmarc:sb" />
+               <xsl:value-of select="tmarc:sf" />
+                   <xsl:value-of select="tmarc:sg" />  
+               <xsl:value-of select="tmarc:sn" />
+               <xsl:value-of select="tmarc:sp" />
+               </xsl:for-each>         
+       </xsl:variable>
+
+       <xsl:variable name="title247">
+               <xsl:for-each select="tmarc:d247" >
+                       <xsl:value-of select="tmarc:sa" />
+                       <xsl:if test="$contains110 and not($hasAuthorFields)">
+                               <xsl:value-of select="tmarc:sb" />
+               <xsl:value-of select="tmarc:sf" />
+                   <xsl:value-of select="tmarc:sg" />  
+               <xsl:value-of select="tmarc:sn" />
+               <xsl:value-of select="tmarc:sp" />
+                       </xsl:if>
+               </xsl:for-each>         
+       </xsl:variable>
+       <xsl:variable name="title247-full">
+               <xsl:for-each select="tmarc:d247" >
+                       <xsl:value-of select="tmarc:sa" />
+                       <xsl:value-of select="tmarc:sb" />
+               <xsl:value-of select="tmarc:sf" />
+                   <xsl:value-of select="tmarc:sg" />  
+               <xsl:value-of select="tmarc:sn" />
+               <xsl:value-of select="tmarc:sp" />
+               </xsl:for-each>         
+       </xsl:variable>
+
+      <xsl:for-each select="tmarc:c008">
+        <pz:metadata type="meta-marc-cf008">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+       <pz:metadata type="meta-frbr-short-title">
+               <xsl:choose>
+               <xsl:when test="$title130!=''">
+                       <xsl:value-of select="$title130" />
+               </xsl:when>             
+               <xsl:when test="$title130='' and $title240!=''">
+                       <xsl:value-of select="$title240" />
+               </xsl:when>             
+                       <!-- Missing the prioritization of 246 on non-english records  -->
+               <xsl:when test="$title130='' and $title240='' and $title242!=''">
+                       <xsl:value-of select="$title242" />
+               </xsl:when>             
+               <xsl:when test="$title130='' and $title240='' and $title242='' and $title245!=''">
+                       <xsl:value-of select="$title245" />
+               </xsl:when>             
+               <xsl:when test="$title130='' and $title240='' and $title242='' and $title246!=''">
+                       <xsl:value-of select="$title246" />
+               </xsl:when>             
+               <xsl:when test="$title130='' and $title240='' and $title242='' and $title246='' and $title247!=''">
+                       <xsl:value-of select="$title247" />
+               </xsl:when>             
+               </xsl:choose>
+       </pz:metadata>
+
+       <pz:metadata type="meta-frbr-full-title">
+               <xsl:choose>
+               <xsl:when test="$title130!=''">
+                       <xsl:value-of select="$title130" />
+               </xsl:when>             
+               <xsl:when test="$title130='' and $title240!=''">
+                       <xsl:value-of select="$title240" />
+               </xsl:when>             
+                       <!-- Missing the prioritization of 246 on non-english records  -->
+               <xsl:when test="$title130='' and $title240='' and $title242!=''">
+                       <xsl:value-of select="$title242-full" />
+               </xsl:when>             
+               <xsl:when test="$title130='' and $title240='' and $title242='' and $title245!=''">
+                       <xsl:value-of select="$title245-full" />
+               </xsl:when>             
+               <xsl:when test="$title130='' and $title240='' and $title242='' and $title246!=''">
+                       <xsl:value-of select="$title246-full" />
+               </xsl:when>             
+               <xsl:when test="$title130='' and $title240='' and $title242='' and $title246='' and $title247!=''">
+                       <xsl:value-of select="$title247-full" />
+               </xsl:when>             
+               </xsl:choose>
+       </pz:metadata>
+
+
+       <pz:metadata type="meta-frbr-lang">
+               <xsl:value-of select="$control_lang" />
+       </pz:metadata>
+
+
+      <!-- passthrough id data -->
+      <xsl:for-each select="pz:metadata">
+          <xsl:copy-of select="."/>
+      </xsl:for-each>
+
+      <!-- other stylesheets importing this might want to define this -->
+      <xsl:call-template name="record-hook"/>
+
+    </pz:record>    
+  </xsl:template>
+  
+  <xsl:template match="text()"/>
+
+  <xsl:template name="shortTitle">
+    <xsl:param name="tag" />
+    <xsl:for-each select="tmarc:d">
+      <xsl:value-of select="tmarc:sa" />
+      <xsl:value-of select="tmarc:sm" />
+      <xsl:value-of select="tmarc:sn" />
+      <xsl:value-of select="tmarc:sp" />
+      <xsl:value-of select="tmarc:sr" />
+    </xsl:for-each>
+  </xsl:template>
+
+
+  <xsl:template name="description">
+    <xsl:param name="element" />
+    <xsl:for-each select="$element">
+       <pz:metadata type="description">
+            <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+    </xsl:for-each>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+
+  <xsl:template name="subject">
+    <xsl:param name="element" />
+      <xsl:for-each select="$element" > 
+        <pz:metadata type="subject">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="subject-long">
+         <xsl:for-each select="node()/text()">
+           <xsl:if test="position() > 1">
+             <xsl:text>, </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+  </xsl:template>
+
+
+</xsl:stylesheet>