Another tricky XSL question:

Im hoping to dig out title and author in General-Handler.xsl. I tried
using the following:


<xsl:variable name="data"
select="mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim"/>
<xsl:variable name="Title" select="$data/dim:fie...@element='title']" />
<xsl:variable name="Author"
select="$data/dim:fie...@element='contributor']...@qualifier='author']"
/ >

But it results to a namespace error in browser. Any hints how can I
get the data out?

Thanks,
Mika




2008/12/29 Andreas Geyrecker <andreas.geyrec...@gmail.com>:
> 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 <mikan.dsp...@gmail.com>
>>
>> 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
>> DSpace-tech@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
>

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to