I added the following template that allows me to output links in my summary
display view.
For those text fields that might contain links, I pass their contents to
the following templates.
<xsl:template match="dim:field" mode="urltext">
<xsl:apply-templates select="*|text()" mode="urltext"/>
</xsl:template>
<xsl:template match="*|@*" mode="urltext">
<xsl:param name="val" select="."/>
<xsl:copy>
<xsl:apply-templates select="*|@*|text()" mode="urltext"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()" mode="urltext">
<xsl:param name="val" select="."/>
<xsl:variable name="valnorm"
select="normalize-space(translate($val,' 	 ',' '))" />
<xsl:variable name="pre">
<xsl:choose>
<xsl:when test="string-length(substring-before($valnorm,' ')) =
0">
<xsl:value-of select="$valnorm"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-before($valnorm,' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="suff" select="substring($valnorm,
string-length($pre) + 1)"/>
<xsl:choose>
<xsl:when test="starts-with($pre,'http://') or
starts-with($pre,'https://') or starts-with($pre,'mailto:')">
<a>
<xsl:attribute name="href">
<xsl:value-of select="$pre"/>
</xsl:attribute>
<xsl:value-of select="$pre"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$pre"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="string-length($suff) > 0">
<xsl:text> </xsl:text>
<xsl:apply-templates select="." mode="urltext">
<xsl:with-param name="val" select="$suff"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
On Mon, Apr 28, 2014 at 3:26 PM, Calloni, Rodrigo <[email protected]> wrote:
> Hello
>
>
>
> We are in DSpace 1.8.2 using XMLUI.
>
>
>
> One of my colleagues wants to add URLs links in the Abstract field
> (dc.description.abstract) and we tried adding something like this to our
> metadata:
>
>
>
> Contents:
>
>
>
> <a href="http://www.yahoo.com">Chapter 1</a>
>
> <a href="http://www.yahoo.com">Chapter 2</a>
>
>
>
> But instead of showing “Chapter 1” and “Chapter 2” to the description,
> DSpace is showing the text exactly as we typed.
>
>
>
> When I look the source code of the page, the text is shown as following:
>
>
>
> <td>Contents:
>
>
>
> <a href="http://www.yahoo.com">Chapter 1</a>
>
> <a href="http://www.yahoo.com">Chapter 2</a></td>
>
>
>
> So, is there a way to achieve what we want and show only Chapter 1 Chapter
> 2 as links in the description?
>
>
>
> Thanks in advance
>
> Rodrigo
>
>
>
> *Rodrigo Calloni*
> System Librarian
>
> Felipe Herrera Library
> Knowledge and Learning Sector
> Tel: 202-623-2952
>
> Fax: 202-623-3183
> [image: Description: http://www.iadb.org/email/idb.gif]
> 1300 New York Avenue, N.W.
> Washington, D.C. 20577
> USA
> *www.iadb.org <http://www.iadb.org/>*
>
>
>
> *"Knowledge. Empowering People. Transforming Lives."*
>
> *P* *Please consider the environment before printing this email*
>
>
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos. Get
> unparalleled scalability from the best Selenium testing platform available.
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette:
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>
--
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
https://www.library.georgetown.edu/lit/code
202-687-7053
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette