What version of Umbraco are you using? If it's older than v6 then you can add ?umdebugshowtrace=1 to your page url to see if it reveals some more information about the error.
If it's v6+ then go to /app_data/logs and search for "ERROR" and see if it reveals anything.
However I think the issue probably is a missing id or an image node that has no image mapped to it.
I would probably also spend some time refactoring the above XSLT code...however a minor suggestion that is easy to quickly implement to avoid this from happening again would be to define your
mediaImage variable right after the for-each loop so you define it here
<xsl:for-each select="umbraco.library:GetXmlNodeById(1074)/BannerImage [@isDoc]">
<xsl:variable name="mediaImage" select="umbraco.library:GetMedia(bannerImage, false())" />
<!-- Make sure the $mediaImage variable is not empty -->
<xsl:if test="normalize-space($mediaImage)">
<!-- Place your when test here -->
</xsl:if>
</xsl:for-each>
In the above example you eliminate that the error is occuring since it will never move into the if statement if $mediaImage is empty.
XSLT Code suddenly stopped working!
Hello,
I had a XSLT script that was listing out some images on a page, that was working perfectly, and has suddenly stopped this morning or over the weekend.
The content editor did add some more images to the list but has done everything correctly.
Is there a problem that I don't know about, or is there a problem in this code below?
The folder that holds all the images in the content section has Id 1074.
I have also written this out in Razor to see if that worked but no luck.
Can anyone advise what's going on? As I say, it did work perfectly, for about 2 months.
Thanks John
Hi John,
Code looks good to me, what kind of output / error do you get now?
I would try unpublishing the newly added nodes, to identify the one that makes problems.
Maybe a corrupt image or problems with xml cache?
Christian
Hi Christian,
I'm getting this error on the site "Error parsing XSLT file: \xslt\Banner.xslt".
I'll check each image.
Hi John
What version of Umbraco are you using? If it's older than v6 then you can add ?umdebugshowtrace=1 to your page url to see if it reveals some more information about the error.
If it's v6+ then go to /app_data/logs and search for "ERROR" and see if it reveals anything.
However I think the issue probably is a missing id or an image node that has no image mapped to it.
Just my 2 cents.
/Jan
Its OK, I figured it out.
The user had published a node that had no image on it, so the script didn't know what to do. Partly my fault I guess.
It works now after I unpublished it.
Thanks for the suggestions.
Hi John
I would probably also spend some time refactoring the above XSLT code...however a minor suggestion that is easy to quickly implement to avoid this from happening again would be to define your
mediaImage variable right after the for-each loop so you define it here
In the above example you eliminate that the error is occuring since it will never move into the if statement if $mediaImage is empty.
Hope this helps and that it makes sense.
Cheers, Jan
Hi Jan,
Yes I already added an if statement this morning to stop this problem.
Thanks John
is working on a reply...