xsl group problem

wxdqz

New Member
Hi

I have an xsl document which lists sections on the website, the xml doc looks like this:


<root>
<row>
<admin_submitted>false<admin_submitted>
<title>User submitted section</title>
</row>
<row>
<admin_submitted>false<admin_submitted>
<title>User submitted section 2</title>
</row>
<row>
<admin_submitted>true<admin_submitted>
<title>Some title</title>
</row>
<row>
<admin_submitted>true<admin_submitted>
<title>Some title 2</title>
</row>
</root>


I was wondering how its possible to list the two sections so they are grouped by whether they were submitted by ad in or not. So far I have




<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">



<xsl:template match="/">

<h2>Sections</h2>

<div>


<ul>

<xsl:for-each select="/root/row">

<xsl:sort select="title" order="ascending" />

<li>

<a href=http://www.webdeveloper.com/forum/archive/index.php/"#">

<xsl:value-of select="title" />

</a>

</li>

</xsl:for-each>

</ul>

</div>


<input id="addTitle" type="button" value="Add New Title" />

</xsl:template>


</xsl:stylesheet>


Thanks!
 
Back
Top