Xml Related.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PrinsonG
    New Member
    • Oct 2007
    • 4

    Xml Related.

    I have generated three xml files.

    say xmlfile1 :

    <Users>
    <User>
    <UserID>1</UserID>
    <UserName>xyz </UserName>
    <UserID>2</UserID>
    <UserName>uuu </UserName>
    </User>
    </Users>

    xmlfile2:

    <Breaks>
    <Break>
    <Date>Current </Date>
    <StartTime>ssss </StartTime>
    <EndTime>uuu</EndTime>
    <Date>Current 1</Date>
    <StartTime>ssss 1</StartTime>
    <EndTime>uuu1 </EndTime>
    </Break>
    </Breaks>

    xmlfile3 :

    <Details>
    <Detail>
    <Date>rrrr</Date>
    <StartTime>ww w</StartTime>
    <EndTime>ttt</EndTime>
    <Date>rrr1</Date>
    <StartTime>www1 </StartTime>
    <EndTime>ttt1 </EndTime>
    </Detail>
    </Details>

    I want to read Node like this format

    that gives me:
    UserID UserName
    1 xyz

    Date StartTime EndTime
    Current ssss uuu

    Date StartTime EndTime
    rrr www ttt


    But My Problem is output:


    UserID UserName
    1 xyz
    2 uuu
    Date StartTime EndTime
    Current ssss uuu
    Current1 ssss1 uuu1
    Date StartTime EndTime
    rrr www ttt
    rrr1 www 1 ttt1

    Its gives me first all user id and names then all breaks then all logindetails.
    may be due to foreach it may happen. Is their any way to do this.
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    What code did you use?

    Comment

    • radcaesar
      Recognized Expert Contributor
      • Sep 2006
      • 759

      #3
      U can use XPATH to cahieve this with out pain.

      Comment

      • PrinsonG
        New Member
        • Oct 2007
        • 4

        #4
        Originally posted by kenobewan
        What code did you use?
        I use C#.Net. Then first i generate the xml files. The number of xml files are 3.

        And then from those three xml i export to CSV.

        Comment

        Working...