Re: [greenstone-users] ex.Date format

From Katherine Don
DateTue, 28 Mar 2006 09:01:20 +1200
Subject Re: [greenstone-users] ex.Date format
In-Reply-To (52B914D66FE6974A952ECCACE81B36428F58CF-libmail1-libad-csus-edu)
Hi Bin

This is a bug in PagedImgPlug - you can fix it by editing the plugin:
file greenstone/perllib/plugins/PagedImgPlug.pm,

look for the function xml_text:

sub xml_text {
my $self = shift(@_);
my ($expat) = @_;

if ($self->{'element'} eq "Metadata") {
$self->{'metadata_value'} .= $_;
}
}

And change it to

sub xml_text {
my $self = shift(@_);
my ($expat) = @_;

if ($self->{'element'} eq "Metadata" && $self->{'metadata_name'}) {
$self->{'metadata_value'} .= $_;
}
}

(i.e. add the extra test into the if statement)

Then you'll need to reimport.

Regards,
Katherine

Bin Zhang wrote:
> I am using an XML file for items in a scanned book (PagedImgPlug). The document metdata Date has the value "198412" for December 1984. However the date was displayed as 198 on the webpage using [ex.Date] in Vlist. I created a browsing classifier using DateList. When I click on Dates from the navigation bar, it displayes as:
>
> 198 _textmonth41_
>
> Here is what the .item file looks like:
>
> <PagedDocument>
> <Metadata name="Title">?????</Metadata>
> <Metadata name="Contributor">??</Metadata>
> <Metadata name="Date">19841201</Metadata>
> <Page imgfile="chaa00001_0003.jpg">
> <Metadata name="Title">Forword</Metadata>
> </Page>
> <Page imgfile="chaa00001_0004.jpg">
> <Metadata name="Title">Table of Contents</Metadata>
> </Page>
> ...
>
> And here is what the doc.xml looks like:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE Archive SYSTEM "http://greenstone.org/dtd/Archive/1.0/Archive.dtd">
> <Archive>
> <Section>
> <Description>
> <Metadata name="gsdlsourcefilename">import/100028.item</Metadata>
> <Metadata name="gsdldoctype">indexed_doc</Metadata>
> <Metadata name="gsdlthistype">Hierarchy</Metadata>
> <Metadata name="Source">100028.item</Metadata>
> <Metadata name="Title">?????</Metadata>
> <Metadata name="Contributor">
> ??</Metadata>
> <Metadata name="Date">
> 198412</Metadata>
> <Metadata name="Plugin">PagedImgPlug</Metadata>
> <Metadata name="FileFormat">PagedImg</Metadata>
> <Metadata name="NumPages">7</Metadata>
> <Metadata name="Identifier">HASH01abb338756474b143efd1ce</Metadata>
> <Metadata name="hascover">1</Metadata>
> <Metadata name="lastmodified">1143486982</Metadata>
> <Metadata name="assocfilepath">HASH01ab.dir</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0003.jpg:image/JPEG:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0003sv.jpg:image/jpg:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0004.jpg:image/JPEG:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0004sv.jpg:image/jpg:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0005.jpg:image/JPEG:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0005sv.jpg:image/jpg:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0006.jpg:image/JPEG:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0006sv.jpg:image/jpg:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0007.jpg:image/JPEG:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0007sv.jpg:image/jpg:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0008.jpg:image/JPEG:</Metadata>
> <Metadata name="gsdlassocfile">chaa00001_0008sv.jpg:image/jpg:</Metadata>
> <Metadata name="gsdlassocfile">cover.jpg:image/jpeg:</Metadata>
> </Description>
> ...
>
>
> Can someone tell me what the problem is? Thanks!
>
> --------------------------
> Bin Zhang, Digital Information Services Librarian
> Library Information Systems
> California State University, Sacramento
> 2000 State University Drive, East, Sacramento, CA 95819-6039
> +1 (916) 278-5664 (office); +1 (916) 278-3891 (fax)
> bzhang@csus.edu
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users