Hi I have an XML file called structure which shows the hierarchical structure of my website using outline elements.
I want to output a nested list of all pages for a sitemap. I tried this type of approach to output a list item then the next level of ul (if it has a child).
However the problem is that when 2 list items on the level have children ALL the children are shown for each li with children. I only want the children for each list item to be shown.Code:<xsl:template match="/opml/body/outline/outline"> <li> <a> <xsl:attribute name="href"> <xsl:value-of select="@rel_url"/></xsl:attribute> <xsl:value-of select="@text" /> </a> <!-- if there is a child element --> <xsl:if test="*"> <ul> <xsl:apply-templates select="/opml/body/outline/outline/outline" /> </ul> </xsl:if> </li> </xsl:template>
Any ideas?




Bookmarks