It is the first time I am using XSLT and I am having some difficulties to adapt to it.
Here is my issue. I am trying to do a simple sequence rupture to break a list of items into several chunks. Something fairly simple to do in C# but might be difficult to realize in XSLT.
Here is my code:
[quote]
[/quote]
What I am trying to do is to divide my list into chunks of four elements but I get the following error message:
[quote]System.Xml.XmlException: The 'xsl:if' start tag on line 20 does not match the end tag of 'ul'. Line 21, position 3. [/quote]
Obviously in the logic above the open ul tag will always find a closing tag. It must be somekind of XSLT restriction.
Can somebody explain me how to do sequence rupture in XSLT?
In the xslt instead of writing out the actual tag eg you write <td> or whatever, xslt when it encounters a tag will look for end tag but if it encounters text then it wont and thus you wont get compile error.
In the xslt instead of writing out the actual tag eg you write <td> or whatever, xslt when it encounters a tag will look for end tag but if it encounters text then it wont and thus you wont get compile error.
Regards
Isamil[/quote]
Hello Isamil,
You misunderstood my question.
I have implemented your solution but now when I place the macro on the page it displays the html as it doesn't unescape the content on display.
I wanted to know how to tell Umbraco to unescape the content on call of the macro.
You probably need to use the disable-output-escaping="yes" parameter on your xsl:value-of statement.
Here's an example I wrote for the Runway Gallery Module, from the GalleryListPhotos.xslt file. You'll see that I needed to rupture the xslt much the same as you want to. So... I created a couple variables to hold the escaped text for the tags (the idea Ismail is talking about). But, using variables rather than just typing the escaped code directly, I get to specify that want to disable the automatic output escaping.
Here's the relevant part of the xslt file for reference:
Sequence Rupture in XSLT
Hello,
It is the first time I am using XSLT and I am having some difficulties to adapt to it.
Here is my issue. I am trying to do a simple sequence rupture to break a list of items into several chunks. Something fairly simple to do in C# but might be difficult to realize in XSLT.
Here is my code:
[quote]
[/quote]
What I am trying to do is to divide my list into chunks of four elements but I get the following error message:
[quote]System.Xml.XmlException: The 'xsl:if' start tag on line 20 does not match the end tag of 'ul'. Line 21, position 3. [/quote]
Obviously in the logic above the open ul tag will always find a closing tag. It must be somekind of XSLT restriction.
Can somebody explain me how to do sequence rupture in XSLT?
Thank you.
Didier,
Is because you have start td and end ul in if statement and end td outside of it. what you will need to do is put the start and end td in encoded eg:
[code]
<td>
[/code]
also do the same for other bits that are inside / outside of if statements.
Regards
Ismail
[quote=imayat12]Didier,
Is because you have start td and end ul in if statement and end td outside of it. what you will need to do is put the start and end td in encoded eg:
[code]
<td>
[/code]
also do the same for other bits that are inside / outside of if statements.
Regards
Ismail[/quote]
Hello Ismail,
How do you tell umbraco that he needs to unescape the content on display?
Thank you.
Didier
didier,
In the xslt instead of writing out the actual tag eg you write <td> or whatever, xslt when it encounters a tag will look for end tag but if it encounters text then it wont and thus you wont get compile error.
Regards
Isamil
[quote=imayat12]didier,
In the xslt instead of writing out the actual tag eg you write <td> or whatever, xslt when it encounters a tag will look for end tag but if it encounters text then it wont and thus you wont get compile error.
Regards
Isamil[/quote]
Hello Isamil,
You misunderstood my question.
I have implemented your solution but now when I place the macro on the page it displays the html as it doesn't unescape the content on display.
I wanted to know how to tell Umbraco to unescape the content on call of the macro.
Thank you.
Didier
Anybody else could help me with this issue?
Thank you.
Didier [-o<
You probably need to use the disable-output-escaping="yes" parameter on your xsl:value-of statement.
Here's an example I wrote for the Runway Gallery Module, from the GalleryListPhotos.xslt file. You'll see that I needed to rupture the xslt much the same as you want to. So... I created a couple variables to hold the escaped text for the tags (the idea Ismail is talking about). But, using variables rather than just typing the escaped code directly, I get to specify that want to disable the automatic output escaping.
Here's the relevant part of the xslt file for reference:
[code]
[/code]
cheers,
doug.
Thank you very much.
It works!
Didier
is working on a reply...