Update of /var/cvs/applications/richtext/config/xslt
In directory james.mmbase.org:/tmp/cvs-serv25911
Modified Files:
2xhtml.xslt
Log Message:
added some stuff to deal with 'relative' urls. Should perhaps be done in an
url-function in java in stead, to be more generally available
See also: http://cvs.mmbase.org/viewcvs/applications/richtext/config/xslt
Index: 2xhtml.xslt
===================================================================
RCS file: /var/cvs/applications/richtext/config/xslt/2xhtml.xslt,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- 2xhtml.xslt 23 Jun 2008 08:45:10 -0000 1.28
+++ 2xhtml.xslt 24 Jul 2008 10:45:48 -0000 1.29
@@ -3,7 +3,7 @@
org.mmbase.bridge.util.Generator, and the XSL is invoked by FormatterTag.
@author: Michiel Meeuwissen
- @version: $Id: 2xhtml.xslt,v 1.28 2008/06/23 08:45:10 michiel Exp $
+ @version: $Id: 2xhtml.xslt,v 1.29 2008/07/24 10:45:48 michiel Exp $
@since: MMBase-1.6
-->
<xsl:stylesheet
@@ -131,6 +131,23 @@
For url objects the url is the url field.
-->
<xsl:template match="o:[EMAIL PROTECTED] = 'urls']" mode="url">
+ <xsl:choose>
+ <!--
+ this is a bit of a hack.
+ Following functionality should perhaps be peformed by the URL
builder itself.
+ -->
+ <xsl:when test="starts-with(./o:[EMAIL PROTECTED]'url'], '/') or
+ starts-with(./o:[EMAIL PROTECTED]'url'], 'http:') or
+ starts-with(./o:[EMAIL PROTECTED]'url'], 'https:') or
+ starts-with(./o:[EMAIL PROTECTED]'url'], 'mailto:') or
+ starts-with(./o:[EMAIL PROTECTED]'url'], 'ftp:')">
+ <!-- absolute -->
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- relative. But of course that can never be, so this is interpreted
as relative to request context -->
+ <xsl:value-of select="$formatter_requestcontext"
/><xsl:text>/</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:value-of select="./o:[EMAIL PROTECTED]'url']" />
</xsl:template>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs