[daisy] making URL out of field

Karel Vervaeke karel at outerthought.org
Wed Jul 9 22:52:12 CEST 2008


Uh sorry, it should be 
href="{concat('http://example.com/',$myVAR1/@valueFormatted)}"

You probably should also wrap urlencode() around the last part

Karel

Todd Wells schreef:
> Thanks, that helps. The <a href line is not working as you specified.
> Here is what I have in the document-style sheet.
>
> <xsl:variable name="myVAR1" select="@valueFormatted"/>
> <a href="concat('http://example.com/',$myVAR1/@valueFormatted) ">
>    <xsl:value-of select="myVAR1"/>
> </a>
>
> When I look at a page using this styling, the link shows as
> http://daisyserver/path/concat(%27http://%27,$myVAR1/@valueFormatted)
>
> instead of http://example.com/xxxxx
>
> The next line <xsl:value-of select="myVAR1"/> correctly displays the
> value of myVAR1
>
> How do you get the concat to be evaluated within the <a href?  I tried
> using a <xsl  tag instead of the concat, but get an error saying you can
> not use a < inside of an href.
>
>
> -----Original Message-----
> From: daisy-bounces at lists.cocoondev.org
> [mailto:daisy-bounces at lists.cocoondev.org] On Behalf Of Karel Vervaeke
> Sent: Wednesday, July 09, 2008 12:07 AM
> To: Daisy: open source CMS - general mailinglist
> Subject: Re: [daisy] making URL out of field
>
> If I understand your question correctly, you need to create a
> document-styling for your custom document type (see the documentation
> for that)
>
> To generate the url, do something like this:
>
> <xsl:variable name="myField"
> select="d:fields/d:field[@name='MyField']"/>
>
> <a href="concat('http://example.com/foo/bar/',
> $myField/@valueFormatted)">click here</a>
>
> (or replace 'click here' with an xsl:value-of
> select="$myfield/@valueFormatted")
>
> HTH,
> Karel
>
> On Tue, 2008-07-08 at 11:42 -0700, Todd Wells wrote:
>   
>> I have a custom document  type with several text fields.   I would
>> like to make a link in the document using the value in a text field as
>> part of the URL.
>>
>>  
>>
>> What is the best way to approach this?  
>>
>>
>> _______________________________________________
>> daisy community mailing list
>> Professional Daisy support:
>>     
> http://outerthought.org/en/services/daisy/support.html
>   
>> mail to: daisy at lists.cocoondev.org
>> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
>>     
> _______________________________________________
> daisy community mailing list
> Professional Daisy support:
> http://outerthought.org/en/services/daisy/support.html
> mail to: daisy at lists.cocoondev.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
> _______________________________________________
> daisy community mailing list
> Professional Daisy support: http://outerthought.org/en/services/daisy/support.html
> mail to: daisy at lists.cocoondev.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
>   



More information about the daisy mailing list