Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Xsl:variable content should be empty

From: Ronan Klyne <ronan.klyne@----------->
To:
Date: 4/4/2007 9:38:00 AM
This line:
<xsl:variable name="link" select="file_link"> </xsl:variable>
specifies the value of the variable twice - as the result of evaluating
'file_link', and as " " (the contents of the variable element).

You probably want to use:
<xsl:variable name="link" select="file_link" />
and to read up on xsl:variable in the XSL specification.

	# r

Alan Hale wrote:
> I'm a relative newcomer to xslt and I wonder if someone could kindly
> explain to me what is the issue with the following use of xsl:variable
> and how I can correct it:
> 
>       <xsl:for-each select="/fieldguide/account">
>             
>       <xsl:variable name="link" select="file_link"> </xsl:variable>
> 	.
> 	.
> 	<td><a target = "_parent" href="{$link}"><xsl:value-of
> select="species_name"/></a></td>
> 	.
> 	.
> 	</xsl:for-each>
> 
> Here is a fragment of the XML:
> 
> <fieldguide>
>   <account> 
>      <species_name>Octodiceras fontanum</species_name>
>      <file_link>../accounts/mosses/Octodiceras
> fontanum_DMT.pdf</file_link>
>      .
>      .	
>   </account>
> </fieldguide>
> 
> 
> As you can see, I am trying to construct an html link from the filename
> and path held in the <file_link> element.
> 
> This works fine when I call the stylesheet in-line or from Javascript in
> Internet Explorer, but when I run it with the PHP XSL extension, it
> generates a warning: Xsl:variable content should be empty since select
> is present. It's only a warning and the output is still as expected, but
> clearly I'm doing something wrong.
> 
>>From reading up it seems to me this IS an xslt issue rather than a PHP
> one. I just don't understand it.
> 
> Glad of any help.
> 
> Alan Hale
> Aberystwyth
> Wales
> 
> 
> 
> 	
> 


-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@xxxxxxxxxxx
www.groupbc.com


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent