Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Help with writing select data

From: Joe Kesselman <keshlam-nospam@-------.--->
To: NULL
Date: 11/3/2006 8:09:00 PM

Patrick wrote:
> I am working with global variables.

Sorry, I did misread your question. I should learn not to type when tired...

> <xsl:variable name="moorname" select="'C10AB'" >
>   <html>
>   <body>
>   <xsl:call-template name="show_moor">
>     <xsl:with-param name="moornameToSelect" />
>     </xsl:call-template>
>   </body>
>   </html>
> </xsl:variable>

This is a problem. You are simultaneously trying to set $moorname to the 
literal string C10AB and to contain a Result Tree Fragment which is your 
little <html>...</html> block. You can't do both; the variable can have 
only one value, and according to the XSLT spec this block of code is an 
error -- if the select attribute is specified, the content MUST be empty.

So your first step should be replace that with something legal. Get rid 
of either the contents, or the select.


Next step: Decide what your calling sequence is supposed to be here. Are 
you really trying to call the same template to build a result tree 
fragment in a variable -- which then gets used only to extract the text 
nodes back out of it, since that's the definition of value-of when 
applied to an RTF -- and as the root template which attempts to use the 
result of that variable? Think through what you're trying to do -- write 
it out in English -- and then write the code to match it; what you've 
got here really does not make any sense, independent of the 
global-variable issue.


The parameter you're passing (moornameToSelect) is empty, and unused,


> 
> <xsl:template name="show_moor" match="/">
>   <xsl:param name="moornameToSelect" />
>   <xsl:for-each select="active_wfs/deployment">
>     <p>Moorname: <xsl:value-of select="$moorname " /></p>
>     <p>Moortype: <xsl:value-of select="moortype " /></p>
>     <p>Latitude: <xsl:value-of select="lat"  /></p>
>     <p>Longitude: <xsl:value-of select="lon"  /></p>
>     <p>Start: <xsl:value-of select="start"  /></p>
>     <p>End: <xsl:value-of select="end"  /></p>
>   </xsl:for-each>
> </xsl:template>
> 
> </xsl:stylesheet>
> 


-- 
() ASCII Ribbon Campaign  | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry


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