|
maximation
Starting Member
6 Posts |
Posted - 2008-07-15 : 14:27:12
|
| (new to XML Stuff trying to Generate a hierarchy of XML nodes ) I'm exporting out into XML format just like the way I receive but I'm not able to shape it the way I receive it.Below is how I receive the file and this is how I want my output to be like <ParentEvents><ParentEvent> <TranType>N</TranType> <Studio> <StudioID>1001</StudioID> <Name>My Studio</Name> <Address> <Address1>1236 Florida Dr</Address1> <City>South</City> <State>Beach</State> <Zip>21045</Zip> </Address> <Phone>214-548-8785</Phone> <StudioContact>David Thomas</StudioContact> </Studio> <OnsiteProducerfirstName> Harold </OnsiteProducerfirstName> <OnsiteProducerLastName>Campbell</OnsiteProducerLastName> </ParentEvent></ParentEvents>Instead my output looks like below.<ParentEvents> <ParentEvent> <TranType>N</TranType> <OnsiteProducerfirstName>Harold</OnsiteProducerfirstName> <OnsiteProducerLastName>Campbell</OnsiteProducerLastName></ParentEvent><Studio> <Studioid>1001</Studioid> <Name>My Studio</Name> <Phone>214-548-8785</Phone> <StudioContact>Very Good AV</StudioContact></Studio> <Address> <Address1>12 Florida Dr</Address1> <City>Orlando</City> <State>Florida</State> <Zip>21045</Zip></Address></ParentEvents>My Query looks like this SELECT top 1 1 as TAG, NULL as Parent, null as [ParentEvents!1!identifier], null as [ParentEvent!3!TranType!element], null as [Studio!4!Studioid!element], null as [Studio!4!Name!element], null as [Address!2!Address1!element], null as [Address!2!City!element], null as [Address!2!State!element], null as [Address!2!Zip!element], null as [Studio!4!Phone!element], null as [Studio!4!StudioContact!element], null as [ParentEvent!3!OnsiteProducerfirstName!element], null as [ParentEvent!3!OnsiteProducerLastName!element]FROM tblParentEventUNION ALLSELECT 3, 1, intid_pk, TranType, null, null,null,null,null,null,null,null, [OnsiteProducerfirstName]. [OnsiteProducerLastName]FROM tblParentEventUNION ALLSELECT 4, 1, intid_pk, NULL, Studioid, name, null,null,null,null, [Phone], [Comments], NULL, NULLFROM tblParentEventUNION ALLSELECT 2, 1, intid_pk, NULL,NULL,null, [Address1], [City], [State], Zip], NULL,NULL,NULL,NULLFROM tblParentEventFOR XML EXPLICITAny help would highly be appreciated.Thanks |
|