Sending again. I think a problem occurred on first attempt.

Hi,
We're using XMLUI, Dspace 1.5.1.

Does anybody know what's the code to extract filenames from mimetype in
order to display icons besides titles?

I'm using the code below with provenance field, but it´s not working. It
works only if the field contains the exact content of the text i put in
code.

<xsl:template match="mets:fileSec" mode="artifact-preview">
<xsl:choose>
<xsl:when test="ancestor::mets:METS//dim:fie...@element='description' and
@qualifier='provenance']
                [text()='pdf']"><br/>
<xsl:value-of select="$theme-path"/>
<xsl:text>/images/image.jpg</xsl:text>                          
</xsl:when>
</xsl:choose>
</xsl:template>
________________________________________
I tried Mika's code, without success. 

I still tried the code below (from http://www.slideshare.net/tdonohue/  ),
but didn't work:

<xsl:template match=“mets:file”>
<xsl:call-template name="getFileFormatIcon">
<xsl:with-param name="mimetype">
<xsl:value-of select="@MIMETYPE "/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

<xsl:template name=“getFileFormatIcon”>

<xsl:when test=“$mimetype=‘application/pdf’">
<xsl:value-of select="$theme-path"/>
<xsl:text>/images/pdf.png</xsl:text>
</xsl:when>
________________


Any help?

Fabricio Costa



____________________________________________________________________________
__________________________
Re: Extracting Filenames
From: Scott Phillips <scott.phill...@gm...> - 2007-03-22 19:24 
Mika,

Instead of parsing the filename for a file name extension I would use
the file's mime-type. This is encoded in the METS document for each
items, thus:

<mets:file SIZE="2327279" GROUP_ID="group_file_43798"
CHECKSUM="394e1c141e1c80cad646df2c2a5142ec" MIMETYPE="application/pdf"
CHECKSUMTYPE="MD5" ID="file_43798">
<mets:FLocat LOCTYPE="URL"
xlink:href="/manakin/bitstream/handle/1969.1/4448/etd-tamu-2006B-VIZA-Shah.p
df?sequence=2"
xlink:title="etd-tamu-2006B-VIZA-Shah.pdf" xlink:type="locator"/>
</mets:file>

In this case you can see the MIMETYPE says that it is
"application/pdf". This is determined by mimetype is listed in the
bitstream registry.

Scott--

On 3/22/07, Mika Stenberg <mika.stenb...@he...> wrote:
> Im trying to create icons in front of the items, so that an item with
> pdf-file would show pdf icon and so on. I managed to do this by
> examinining the field dc.provinence, since Dspace writes the filename
> there. However, I have items that have pdf-files added later on and they
> do not have this information on dc.provinence field.
>
> So my question is, how can I dig out the filenames for further
> examination, preferably concatenate into a one string.
>
> I also tries the for-each loop that prints out the filenames, but since
> I cant do choose inside for-each, Im out of ideas. Any ideas?
>
> -Mika
>
>
> <xsl:variable name="isPdf"
>
select="$data/dim:fie...@element='description']...@qualifier='provenance']"/>
>
>
> <xsl:choose>
> <xsl:when test="contains($isPdf, 'pdf') " >
> <img src="pixel.gif" border="0" height="0"
> width="30" />
> </xsl:when>
> <xsl:choose>
>
>
>
> -Mika
>
>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to