xsl-list
[Top] [All Lists]

SQL BTree to XML Tree?

2006-01-18 02:34:04
Hi all

I'm storing a btree in sql in the following manner:

+----------------------------+
| Table: Departments         |
+----------------------------+
| id | name        | lh | rh |
+----------------------------+
| 1  | Managers    | 1  | 6  |
| 2  | Supervisors | 2  | 5  |
| 3  | Employees   | 3  | 4  |
| 4  | Directors   | 7  | 8  |
+----------------------------+

This is being converted to xml, resulting in:

<output>
 <item>
   <id>1</id>
   <name>Managers</name>
   <lh>1</lh>
   <rh>2</rh>
 </item>
<!-- etc -->
</output>

I need to translate this using XSL to this:

<group>
 <department title="Managers">
   <department title="Supervisors" />
   <department title="Employees" />
 </department>
 <department title="Directors" />
</group>

Any idea how I can do this?

Thanks

Phill


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>