[Net-z3950] elementSet and XML record syntax

Sigfrid Lundberg sigfrid.lundberg at lub.lu.se
Thu Jun 17 15:50:19 CEST 2004


On Thu, 17 Jun 2004, Mike Taylor wrote:

> > print $rs->option("elementSetName");
> >
> > prints a 'B', and will ask for brief records, which Zebra cannot
> > provide in the database I've got.
>
> Hah!  That's funny.  Yes, it's a consequence of the way the modules
> uses an undefined value to mean "No value set at this level".  The
> result is that the module-wide default gets used.  Tricky one.  Have
> you tried using a zero-length string?

I tested:
---------

Doing

	$rs->option(preferredRecordSyntax => "XML");
	print "Setting undef\n";
	$rs->option("elementSetName" => undef);
	print $rs->option("elementSetName") . "\n";

prints:

	Setting undef
	B

Doing:

	print "Setting empty string\n";
	$rs->option("elementSetName" => '');
	print $rs->option("elementSetName") . "\n";

prints

	Setting empty string


i.e., an empty string!

Then to continue

	my $n = $rs->size();
	print "found $n records:\n";
	foreach my $i (1 .. $n) {
	    my $rec = $rs->record($i) or die $rs->errmsg();

		......
	}

in either case

	found 158 records:

and however I try I then get :-(


	Specified element set name not valid for specified database at
	./test-sciecom.pl line 34.


Sigge







More information about the Net-z3950 mailing list