Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Didier 25 posts 90 karma points
    Apr 20, 2009 @ 02:35
    Didier
    0

    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.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Apr 20, 2009 @ 09:50
    Ismail Mayat
    0

    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

  • Didier 25 posts 90 karma points
    Apr 21, 2009 @ 04:46
    Didier
    0

    [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

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Apr 21, 2009 @ 10:04
    Ismail Mayat
    0

    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

  • Didier 25 posts 90 karma points
    Apr 21, 2009 @ 19:02
    Didier
    0

    [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

  • Didier 25 posts 90 karma points
    May 10, 2009 @ 02:37
    Didier
    0

    Anybody else could help me with this issue?

    Thank you.

    Didier [-o<

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 11, 2009 @ 12:44
    Douglas Robar
    0

    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.

Copy Link
  • Didier 25 posts 90 karma points
    May 17, 2009 @ 22:05
    Didier
    0

    Thank you very much.

    It works!

    Didier

    Copy Link
  • Please Sign in or register to post replies

    Write your reply to:

    Draft