projects
/
irspy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7ec0482
)
Default set is emitted as a URI, not a prefix.
author
Mike Taylor
<mike@indexdata.com>
Tue, 20 Jun 2006 11:05:43 +0000
(11:05 +0000)
committer
Mike Taylor
<mike@indexdata.com>
Tue, 20 Jun 2006 11:05:43 +0000
(11:05 +0000)
zebra/ezeerex2pqfproperties.pl
patch
|
blob
|
history
diff --git
a/zebra/ezeerex2pqfproperties.pl
b/zebra/ezeerex2pqfproperties.pl
index
1155b4c
..
33cb0c0
100755
(executable)
--- a/
zebra/ezeerex2pqfproperties.pl
+++ b/
zebra/ezeerex2pqfproperties.pl
@@
-1,6
+1,6
@@
#! /usr/bin/perl -w
#! /usr/bin/perl -w
-# $Id: ezeerex2pqfproperties.pl,v 1.5 2006-06-19 16:45:18 mike Exp $
+# $Id: ezeerex2pqfproperties.pl,v 1.6 2006-06-20 11:05:43 mike Exp $
#
# Run like this:
# ./ezeerex2pqfproperties.pl zeerex.xml
#
# Run like this:
# ./ezeerex2pqfproperties.pl zeerex.xml
@@
-17,8
+17,8
@@
my $root = $doc->getDocumentElement();
my $xc = XML::LibXML::XPathContext->new($root);
$xc->registerNs(z => 'http://explain.z3950.org/dtd/2.0/');
my $xc = XML::LibXML::XPathContext->new($root);
$xc->registerNs(z => 'http://explain.z3950.org/dtd/2.0/');
-print_sets($xc);
-print_default_set($xc);
+my %setmap = print_sets($xc);
+print_default_set($xc, \%setmap);
print_indexes($xc);
print_relations($xc);
print_relation_modifiers($xc);
print_indexes($xc);
print_relations($xc);
print_relation_modifiers($xc);
@@
-30,27
+30,35
@@
print_truncations($xc);
# SRU index: that way we could avoid defining
# set.bib1 = 1.2.840.10003.3.1
# which is a Z39.50 attribute set that we don't need for CQL. But
# SRU index: that way we could avoid defining
# set.bib1 = 1.2.840.10003.3.1
# which is a Z39.50 attribute set that we don't need for CQL. But
-# doing that would be a marginal gain.
+# doing that would be a lot of work for marginal gain.
#
sub print_sets {
my($xc) = @_;
#
sub print_sets {
my($xc) = @_;
+ my %setmap;
my(@nodes) = $xc->findnodes('z:indexInfo/z:set');
foreach my $node (@nodes) {
my $name = $node->findvalue('@name');
my $identifier = $node->findvalue('@identifier');
print "set.$name = $identifier\n";
my(@nodes) = $xc->findnodes('z:indexInfo/z:set');
foreach my $node (@nodes) {
my $name = $node->findvalue('@name');
my $identifier = $node->findvalue('@identifier');
print "set.$name = $identifier\n";
+ $setmap{$name} = $identifier;
}
}
+
+ return %setmap;
}
sub print_default_set {
}
sub print_default_set {
- my($xc) = @_;
+ my($xc, $setmap) = @_;
my (@nodes) = $xc->findnodes('z:configInfo/' .
'z:default[@type="contextSet"]');
foreach my $node (@nodes) {
my (@nodes) = $xc->findnodes('z:configInfo/' .
'z:default[@type="contextSet"]');
foreach my $node (@nodes) {
- ### Look this up and render as a URI
- print "set = ", $node->findvalue('.'), "\n";
+ my $name = $node->findvalue('.');
+ my $identifier = $setmap->{$name}
+ or die "no identifier for default context-set name '$name'";
+
+ print "# default context-set name '$name'\n";
+ print "set = $identifier\n";
}
}
}
}