Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

XSL styling with <ul>

Options
  • 13-05-2008 11:58am
    #1
    Registered Users Posts: 2,791 ✭✭✭


    Hi,

    I have to display 3 items in a list using XSL for a web part in Sharepoint 2007.

    How can I go about specifying the opening & close <UL> tags? Any method I have tried as resulted in a <ul></ul> for each list item

    I would greatly appreciate and help or advice.

    Thanks
    John


Comments

  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Can you try rephrasing the question?


  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    Ginger wrote: »
    Can you try rephrasing the question?

    Sorry, I was in a bit of a rush :o

    I am styling a content query webpart in ItemStyle.xsl.

    The webpart needs to display the next 3 upcoming events from a Sharepoint list, in a HTML unordered list.

    I am unsure of how to implement this in XSL, as I cannot apply the <ul> tag at the start and </ul> at the end. Each of the events could then be rendered like so:<li><xsl:value-of select="document"/></li>

    The closest I can get to this is each of the 3 items being rendered in their own unordered list:

    <ul><li><xsl:value-of select="document"/></li></ul>


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Use a match template

    http://www.w3schools.com/XSL/el_template.asp

    Wrap the match template in an UL element and then each element apply the LI


  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    Ginger wrote: »
    Use a match template

    Nice one, thanks!


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    My own post was a rush job but have a look at the revised post..

    so what you will have is
    <ul>
    <xsl:apply-templates select="document" />
    </ul>
    
    <xsl:template match="document">
    <li><xsl:value-of select="." /></li>
    </xsl:template>
    
    

    Or something similar


  • Advertisement
  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    That seems to make sense, sound man I really appreciate it! :)


Advertisement