DataSet: Nested Tables in XML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?RnJhbmsgVXJheQ==?=

    #1

    DataSet: Nested Tables in XML

    Hi all

    I got some trouble with creating XML Files.

    I have a DataSet with two tables (Calendar and holidays)
    and a Relationship (Nested = true) between both tables ("name").

    When I now write the XML I get:
    <Static>
    <Calendar>
    <name>AED</name>
    <holidays>
    <name>AED</name>
    <holiday>2008-12-08</holiday>
    </holidays>
    <holidays>
    <name>AED</name>
    <holiday>2008-12-10</holiday>
    </holidays>
    </Calendar>
    </Static>

    What I need is this:
    <Static>
    <Calendar>
    <name>AED</name>
    <holidays>
    <holiday>2008-12-08</holiday>
    <holiday>2008-12-10</holiday>
    </holidays>
    </Calendar>
    </Static>

    Does anybody knows how this can be done ??

    Thanks a lot for any comments.

    Best regards
    Frank

  • sloan

    #2
    Re: DataSet: Nested Tables in XML

    DataSet xml is best used with relational tables...and not nesting.

    You can use this trick if necessary:

    http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!148.entry




    "Frank Uray" <FrankUray@disc ussions.microso ft.comwrote in message
    news:01343959-1765-44D8-B263-6013C7A4A826@mi crosoft.com...
    Hi all
    >
    I got some trouble with creating XML Files.
    >
    I have a DataSet with two tables (Calendar and holidays)
    and a Relationship (Nested = true) between both tables ("name").
    >
    When I now write the XML I get:
    <Static>
    <Calendar>
    <name>AED</name>
    <holidays>
    <name>AED</name>
    <holiday>2008-12-08</holiday>
    </holidays>
    <holidays>
    <name>AED</name>
    <holiday>2008-12-10</holiday>
    </holidays>
    </Calendar>
    </Static>
    >
    What I need is this:
    <Static>
    <Calendar>
    <name>AED</name>
    <holidays>
    <holiday>2008-12-08</holiday>
    <holiday>2008-12-10</holiday>
    </holidays>
    </Calendar>
    </Static>
    >
    Does anybody knows how this can be done ??
    >
    Thanks a lot for any comments.
    >
    Best regards
    Frank
    >

    Comment

    Working...