cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Heinicke <Joerg.Heini...@gmx.de>
Subject Re: A href in XLS file
Date Mon, 21 Oct 2002 08:47:54 GMT
Hello Jaroslav,

> Hello,
>  
> I have these structure, which I got from DB using esql:get-xml.
>  
> <LUR xmlns="" ...>
>  <PU>
>    <UserID>5<UserID>
>    <Email>jaroslav.kazmir@joanneum.at</Email>
>  </PU>
> </LUR>
>  
> I made an XSL file for format this string, but I have problem with
> clickable
> Email.
>  
> When I used somethink like that, I got email into HREF attributes, but the
> address is added to the end of the current URL address:
>  
> <xsl:template match="Email">
>     <b>
>       <i18n:text>registration_email</i18n:text>
>       <a>
>         <xsl:attribute name="href">
>           mailto:<xsl:value-of select="." />
>         </xsl:attribute>

here maybe the problem is the linebreak before "mailto:". If you have a text
node containing non-whitespace characters, then this text node will be
copied to the output including all whitespace characters. You can change the line
to

            <xsl:text/>mailto:<xsl:value-of select="."/>

>         <xsl:value-of select="." />
>       </a>
>       <br/>
>     </b>
>   </xsl:template>
>  
> I tried to change the template, but I don't know how I could call the
> value
> of Email from the structure otherwise. In this case the calling of mailto:
> is perfect, but the Email address is missing. I tried to find calling the
> value in the manual, but I only found calling of attributes of class or
> calling the children class.
>  
>   <xsl:template match="Email">
>     <b>
>       <i18n:text>registration_email</i18n:text>
>       <a href="mailto:{Email}">

You match already on <Email/>, so you ask for the value of a child element
<Email/>, which you don't have. If you access the value of <Email/> via
<xsl:value-of select="."/>, then you have to do it with the same XPath expression
in the Attribute Value Template:

        <a href="mailto:{.}">

>         <xsl:value-of select="." />
>       </a>
>       <br/>
>     </b>
>   </xsl:template>
>  
> Can anyone help me?
>  
> Thanx a lot.
>  
> Jaroslav Kazmir

Regards,

Joerg

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message