I'm trying to write some xslt that will display a link only if a user is in a particular role. However, I can't get even this basic stub to work (header/preamble omitted)
Whenever I try to save this I get a "System.OverflowException: Value was either too large or too small for an Int32" error. Yet if I change the offending line to
does the xslt save when you check the Skip testing checkbox? and is it runnung fine then?
If so it is the following problem: when the xslt is beeing saved it will be checked against the first node in the content. If this nodes does not contain then macro property it will give you the error that it is not a number. So just wrap an if test around and this will be fine:
Converting String Parameter Value to Number
I'm trying to write some xslt that will display a link only if a user is in a particular role. However, I can't get even this basic stub to work (header/preamble omitted)
<xsl:variable name="pageID" select="/macro/pageID"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<a href="{umbraco.library:NiceUrl(number($pageID))}">Hi There!</a>
</xsl:template>
Whenever I try to save this I get a "System.OverflowException: Value was either too large or too small for an Int32" error. Yet if I change the offending line to
<a href="{umbraco.library:NiceUrl(1212)}">Hi There!</a>
It saves just fine...but it's not very useful :).
I've also tried:
<xsl:variable name="pageID" select="number(/macro/pageID")/>
and
<a href="{umbraco.library:NiceUrl(<xsl:value-of select='number($pageID)')}">Hi There!</a>
which don't work either.
What am I doing wrong?
- Mark
does the xslt save when you check the Skip testing checkbox? and is it runnung fine then?
If so it is the following problem: when the xslt is beeing saved it will be checked against the first node in the content. If this nodes does not contain then macro property it will give you the error that it is not a number. So just wrap an if test around and this will be fine:
hth, Thomas
That did it, thanks!
- Mark
is working on a reply...