forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ritchie Young <Ritchie.Yo...@westone.wa.gov.au>
Subject RE: How to put an @ in a mailto link
Date Fri, 21 Mar 2003 06:05:52 GMT
Thanks for that. The following seems to work for me:

  <xsl:template match="link">
    <xsl:apply-templates select="@id"/>
    <xsl:choose>

      <xsl:when test="starts-with(@href, 'actual-mailto:')">
        <xsl:variable name="mailto-address"
select="substring-after(@href,'actual-mailto:')"/>
          <a href="mailto:{$mailto-address}">
            <xsl:apply-templates/>
          </a>
       </xsl:when>

      <xsl:when test="starts-with(@href, 'mailto:') and contains(@href,
'@')">
        <xsl:variable name="mailto-1" select="substring-before(@href,'@')"/>
        <xsl:variable name="mailto-2" select="substring-after(@href,'@')"/>
          <a href="{$mailto-1}.at.{$mailto-2}">
            <xsl:apply-templates/>
          </a>
       </xsl:when>

        ...
    </xsl:template>

That gives you the choice on a link by link basis which could be regarded as
good or bad.

/Ritchie

-----Original Message-----
From: David Crossley [mailto:crossley@indexgeo.com.au] 
Sent: Friday, 21 March 2003 8:41 AM
To: forrest-dev@xml.apache.org
Subject: Re: How to put an @ in a mailto link

Ritchie Young wrote:
<snip/>
> Presumably, this behaviour is to foil spammers when generating Internet
> sites but can it be circumvented if you really do want to generate a real
> email address?

It is not yet configurable, but could/should be made so.
I have added your suggestion to the todo list.

You could disable this feature by making some modifications
to the src/resources/skins/common/xslt/html/document2html.xsl
at around line 204.

--David


Mime
View raw message