When I remove the trailing "/" from my variable, I get an error saying:
Error occuredSystem.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Double value)
.....
When I remove the variable I don't get any errors. I just don't understand why I can get the correct values (without errors) when using the value-of select, and not in a for-each loop?
As Dennis mentions you can make a check to see if $Links has a value (it does not have a value, when you save the XSLT file and that's why you get the new error). You can also ignore this error by simply just checking the "skip errors" checkbox.
Selection of property on all pages
Hi.
I have a sidebar on my site, and I'm struggling with getting the contents to show on all pages.
This will show the submitted url for a link. It works on all pages regarding of $currentPage.
The problem is that I can't get it to work with a for-each statement (to select every link and populate them in a unordered list.
That would produce an error like this:
System.Xml.Xsl.XslLoadException: Unexpected token '' in the expression.
Maybe I'm not getting the syntax right in the selection?
Thanks in advance!
Hi Stefan
I think there might is a syntax error elsewhere in your code where you have forgotten to add " somewhere.
Could you post all of the code perhaps?
I also suspect you could write the code in a more efficient manner, but let's see what you got right now first :)
/Jan
Here's the code:
From what I've found, It's just the variable "Links" that won't play nice :P
But again, I'm not sure if it's the correct syntax used in select="", even though it's working just fine in other contexts.
Hi Stefan
Try removing the last "/" in your variable. That part should not be neccesary.
/Jan
When I remove the trailing "/" from my variable, I get an error saying:
When I remove the variable I don't get any errors. I just don't understand why I can get the correct values (without errors) when using the value-of select, and not in a for-each loop?
Hi Stefan,
I think you have to make a check on the property, To make sure that is not empty. http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
/Dennis
Hi Stefan
As Dennis mentions you can make a check to see if $Links has a value (it does not have a value, when you save the XSLT file and that's why you get the new error). You can also ignore this error by simply just checking the "skip errors" checkbox.
Then your XSLT file should be working just fine.
/Jan
the <xsl:for-each/> requires the nodelist for iterationg..
you should tell it to be get the list of nodes. some what like this in your case
This will loop through all the child doctype of SidebarLinksItem.
is working on a reply...