Error when using apply-templates and getting details from macro
I am seeing a strange error in both 4.5 and also in 4.5.1.
The following code caused the XSLT to not save, and the whole site (including published pages) to stop working for about 2 minutes (or what seems like hours).
When you save this, the $homeMenu variable will be null because the /macro/homeItem doesn't exist at that point - what may happen then, is that somehow the $homePage variable ends up pointing to / since GetXmlNodeById() won't return anything meaningful, and then the apply-templates instruction sends the processor back into the template it's already in...
Try to wrap the <ul> ... apply-templates ... </ul> in an if statement, to make sure that it's a meaningful id you're sending to GetXmlNodeById.
Error when using apply-templates and getting details from macro
I am seeing a strange error in both 4.5 and also in 4.5.1.
The following code caused the XSLT to not save, and the whole site (including published pages) to stop working for about 2 minutes (or what seems like hours).
If I change the line:
To read
Then the XSLT saves and everything is fine.
It does not seem to matter if the item has been created in the macro or not.
What am I missing/doing wrong?
Thanks
TT
Hi TT,
When you save this, the $homeMenu variable will be null because the /macro/homeItem doesn't exist at that point - what may happen then, is that somehow the $homePage variable ends up pointing to / since GetXmlNodeById() won't return anything meaningful, and then the apply-templates instruction sends the processor back into the template it's already in...
Try to wrap the <ul> ... apply-templates ... </ul> in an if statement, to make sure that it's a meaningful id you're sending to GetXmlNodeById.
/Chriztian
Hi Chriztian
Thanks for this, this was the solution.
Also thanks for the reason why as well.
Regards
TT
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.