creating a xml file dynamically using VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harish139
    New Member
    • Jun 2006
    • 3

    #1

    creating a xml file dynamically using VB

    hi,
    i want to create a xml file dynamically,
    that is

    i have 2 arrays, i want to run a program to fill that array, if the array size becomes 2KB i want to create a xml file
    like this

    Code:
     <detail> 
     
    <person> 
    <address> </address> 
    <age> </age> 
    <data>cntents of array 1</data> 
    </person> 
     
    <education> 
    <primary> </primary> 
    <degree> </degree> 
    <data> contents of array 2 </data> 
    </education> 
     
    <person> 
    <address> </address> 
    <age> </age> 
    <data>cntents of array 1</data> 
    </person> 
     
    <education> 
    <primary> </primary> 
    <degree> </degree> 
    <data> contents of array 2 </data> 
    </education> 
     
    <person> 
    <address> </address> 
    <age> </age> 
    <data>cntents of array 1</data> 
    </person> 
     
    <education> 
    <primary> </primary> 
    <degree> </degree> 
    <data> contents of array 2 </data> 
    </education> 
     
     
    </detail>
    i want to repeat this untill data over

    is it possible to do this
    that is, if i accumulated 2KB of data write it into the xml file at the appropriate tag,
    then accumulate next 2KBs of data like that plese help in this regard
    Last edited by Niheel; Aug 22 '06, 04:45 PM.
  • MrSly
    New Member
    • Aug 2007
    • 1

    #2
    Here is an xml data what I want,
    ex.
    I have two tables under a dataset. One id DeptTable and Another table is EmpTable

    DEPTID LOATION EMPID EMPNAME AGE
    --------------------------------
    10 LA 101 Peter 30
    10 LA 102 Joe 20
    20 BOSTON 103 Jean 24
    30 NY 104 Tom 28

    My desired xml like follows:
    <DeptAndEmploye e>
    <Dept id='10' Loc='LA'>
    <Emp eid='101' Name='Peter' Age='30' />
    <Emp eid='102' Name='Joe' Age='20' />
    </Dept>
    <Dept id='20' Loc='BOSTON'>
    <Emp eid='103' Name='Jean' Age='24' />
    </Dept>
    <Dept id='30' Loc='NY'>
    <Emp eid='104' Name='Tom' Age='28' />
    </Dept>
    </DeptAndEmployee >

    Any easy & efficient way to format like this ??
    how about use dataset then go trou the ds to format ??

    any idea ?? via string.Format or xmlreader ?? or other good method

    If any one knows pls do send me the reply to mallela.sriram@ gmail.com
    Thanks a lot !

    Comment

    Working...