Design question about generation of hierarchial xml
input data in form of spreadsheet.
has colums h1, h2, h3 h4, h5, startdate, enddate, height, width, phases , rating
want generate hirerichial xml
h1
h2
h3
h4
h5
that means h4 parent of h5, h3 parent of h4 , on......
format of xml be
<setequipment h1id=<variable h1 excel> type='h1'>
<address height=<variable height> width =<variable width> />
<setequipment h2id=<variable h2 excel> type ='h2'>
<setparentequipment parentequipmentid=<variable h1 excel> type='h1'>
<parentlinkrange start=<variable startdate excel> end=<variable enddate excel> />
</setparentequipment>
<address height=<variable height excel> width=<variable width excel> />
</setequipment>
<setequipment h3id=<variable h3 excel> type ='h2'>
<setparentequipment parentequipmentid=<variable h2 excel> type='h2'>
<parentlinkrange start=<variable startdate excel> end=<variable enddate excel> />
</setparentequipment>
</setequipment>
<setequipment h4id=<variable h4 excel> type ='h4'>
<setparentequipment parentequipmentid=<variable h3 excel> type='h3'>
<parentlinkrange start=<variable startdate excel> end=<variable enddate excel> />
</setparentequipment>
<transformerattributes ratingkva=<variable rating excel> />
</setequipment>
<setequipment h5id=<variable h5 excel> type ='h5'>
<setparentequipment parentequipmentid=<variable h4 excel> type='h4'>
<parentlinkrange start=<variable startdate excel> end=<variable enddate excel> />
</setparentequipment>
<spattributes numberofphases=<variable phases excel> />
</setequipment>
in visual studio 2012
planning data spreadsheet dataset
create following classes
setequipment
setparentequipment
address
transformerattributes
spattributes
using namespace system.linq generate xml
question:
if has suggestion better design can done interested
thanks
hello sairam,
with provided demo file, seems 5 elements(h1~h5) in same level, not have physical hierarchy logic one. this, think need use system.linq.xml construct output format since hierarchy logic(you want) cannot parsed system.linq.xml namespace.
or create physical hierarchy format output xml file setting relationship in dataset, details, check link:
http://stackoverflow.com/a/15166373
regards.
we trying better understand customer views on social support experience, participation in interview project appreciated if have time. helping make community forums great place.
click here participate survey.
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment