Tree structure data in xml .. - XML SOAP

This is a discussion on Tree structure data in xml .. - XML SOAP ; Hi, Can then "for xml" clause directly generate nested xml for data in a tree structure with arbirrary depth? E.G./ For a single region / sub-region table: create table Region (RegionID int identity(1,1) primary key, RegionName varchar(100) not null, ParentRegionID ...

+ Reply to Thread
Results 1 to 3 of 3

Tree structure data in xml ..

  1. Default Tree structure data in xml ..

    Hi,

    Can then "for xml" clause directly generate nested xml for data in a tree
    structure with arbirrary depth?
    E.G./ For a single region / sub-region table:

    create table Region
    (RegionID int identity(1,1) primary key,
    RegionName varchar(100) not null,
    ParentRegionID int references Region(RegionID)
    )



    Regards
    Louis.



  2. Default Re: Tree structure data in xml ..

    ... small mistake: of course the ParentRegionID column should be:

    ParentRegionID int null references Region(RegionID)

    to cater for the "root(s)" of the tree.



  3. Default Re: Tree structure data in xml ..

    In "What's New in FOR XML in Microsoft SQL Server 2005" -
    http://msdn.microsoft.com/library/de.../forxml2k5.asp
    Michael gives an example of using recursive T-SQL functions to achieve
    nesting XML tags up to the nested function invocation limit (32 by default).
    Look for "Recursion and FOR XML".

    In SQL Server 2000 it is not possible. You can always resort to a client
    side solution and reshape non-recursive XML produced on the server with
    XSLT.

    Best regards,
    Eugene
    ---
    This posting is provided "AS IS" with no warranties, and confers no rights.


    "Louis Kriel" <ludez@bla> wrote in message
    news:Oerkm6b5FHA.156@TK2MSFTNGP15.phx.gbl...
    > Hi,
    >
    > Can then "for xml" clause directly generate nested xml for data in a tree
    > structure with arbirrary depth?
    > E.G./ For a single region / sub-region table:
    >
    > create table Region
    > (RegionID int identity(1,1) primary key,
    > RegionName varchar(100) not null,
    > ParentRegionID int references Region(RegionID)
    > )
    >
    >
    >
    > Regards
    > Louis.
    >
    >




+ Reply to Thread

Similar Threads

  1. How to map tree on a data structure
    By Application Development in forum lisp
    Replies: 7
    Last Post: 12-17-2007, 06:56 PM
  2. Replies: 2
    Last Post: 10-30-2007, 09:58 PM
  3. Replies: 1
    Last Post: 10-30-2007, 06:01 PM
  4. Replies: 4
    Last Post: 10-30-2007, 03:21 PM
  5. Data Structure for a Menu Tree
    By Application Development in forum c++
    Replies: 6
    Last Post: 06-06-2007, 06:46 AM