Hi Mika,

you have to define the following global variables in template.xsl:

    <xsl:variable name="externalMetadataURL">
        <xsl:choose>
            <xsl:when
test="/dri:document/dri:body/dri:d...@n='item-view']/dri:references...@type='summaryView']/dri:referen...@type='DSpace
Item']">
                <!-- DSpace item -->
                <xsl:value-of
select="/dri:document/dri:body/dri:d...@n='item-view']/dri:references...@type='summaryView']/dri:referen...@type='DSpace
Item']/@url"/>
            </xsl:when>
            <xsl:otherwise>
<xsl:text></xsl:text>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>
    <!-- get number of files -->
    <xsl:variable name="filecount">
        <xsl:if test="$externalMetadataURL!=''">
            <xsl:value-of select="count(document(concat('cocoon:/',
$externalMetadataURL,
'sections=fileSec&amp;fileGrpTypes=CONTENT'))/mets:METS/mets:fileSec/mets:fileg...@use='CONTENT']/mets:file)"/>
        </xsl:if>
    </xsl:variable>
    <!-- get mimetypes -->
    <xsl:variable name="mimetypes">
                <xsl:if test="$externalMetadataURL!=''">
        <xsl:for-each select="document(concat('cocoon:/',
$externalMetadataURL,
'sections=fileSec&amp;fileGrpTypes=CONTENT'))/mets:METS/mets:fileSec/mets:fileg...@use='CONTENT']/mets:file[not(preceding::mets:file/@MIMETYPE
= @MIMETYPE)]">
            <xsl:value-of select="@MIMETYPE"/>
            <xsl:text> </xsl:text>
        </xsl:for-each>
        </xsl:if>
    </xsl:variable>

Since they are global, you can examine the variables wherever you want!

-Andi


2008/12/29 mikan.d.dspace listmail <[email protected]>

> Perhaps someone could give me a hint on following issues:
>
> 1) I need to count the number of items attached to an item in template.xsl?
>
> 2) If an item has many different files attached to it, I would like to
> create a concatenated string of the file mime-types (and examine this
> string later on). After spending many days trying to achieve this Im
> asking if someone knows a way to do this? I can actually loop through
> the files and write out the mimetypes, but I am not able to
> concatenate them into a string that I could then examine.
>
> Thanks for help once again,
> Mika
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to