Home All Groups Group Topic Archive Search About

How to make a hierarchical XML

Author
28 Feb 2006 1:05 PM
ad
There are four areas in my compays, every employees in my company have his
duty area.
I use a select join statement to make a view form Area and Employee table
like below..

I want to make a hierarchical XML form the view.
The XML is like below

Area        Employee
----------------------------------------
      North Mary
      North John
      North Max
      East Kai
      West Jina
      West John
      South Tim
      South Peeer


<?xml version="1.0"?>
<AreaEmployee>
<Area>
North
<Employee>
  Mary
</Employee>
</Area>
<Area>
North
<Employee>
  John
</Employee>
</Area>
<Area>
North
<Employee>
  Max
</Employee>
</Area>
<Area>
East
<Employee>
  Kai
</Employee>
</Area>
<Area>
West
<Employee>
  Jina
</Employee>
</Area>
</AreaEmployee>

AddThis Social Bookmark Button