Understanding XML source
Hi, I am currently trying to use an XML source and transform into flat file. The input XML has multiple child nodes say <Root node> <Node1/> <Node2/> <Node3> <ChildNode1/> <ChildNode2/> <ChildNode3> <Subnode1/> <Subnode2/> </ChildNode3> </Node3>.... </Root node> I'm not able to see all the nodes from this xml source as output columns. I require each node from this xml to perform some logic and then given as input columns to the flat file. How does this XML source work and how does the nodes in the input XML get transformed into the output columns? Is there any limitation in SSIS with respect to the levels of child nodes that can exist in the XML source. Please share any examples of XML to flat file that i can refer to help me. Thanks, Smeetha
February 16th, 2011 1:15pm

I am still trying to figure out how the XML Source works. My experience has been that the root node does not provide any columns. So all of the nodes that do not have attributes or sub-elements get ignored by the datasource. The Node3 contains sub elements, so the XML datasource creates an output called Node3 with columns ChildNode1, ChildNode2. There is also an arbitrary id created for this node called Node3_Id. There is no ChildNode3 column. That node, since it has sub-elements is treated as a second output called ChildNode3 with columns SubNode1, SubNode2. It also has Node3_Id which matches the parent Node3 for this node. I have had success in working with root nodes by adding an additional root node using the XML task and XSLT.Russel Loski, MCT
Free Windows Admin Tool Kit Click here and download it now
February 16th, 2011 1:26pm

Thanks for the suggestion. I could traverse the nodes by adding the additional root node. I've another query with respect to processing the output columns: As you've mentioned, the output columns would be Node3 with columns ChildNode1, ChildNode2 and the Node3_Id, ChildNode3 with columns SubNode1, SubNode2 and the Node3_Id. I need to pass all these columns as input to the flat file destination. How do i merge these two outputs and access these individual columns within the outputs. Could you please let me know the steps i need to follow? Also if there are any examples i can refer, it would be useful. Thanks, Smeetha
February 17th, 2011 12:12pm

Matt Masson has an excellent blog on this topic: http://blogs.msdn.com/b/mattm/archive/2007/12/11/using-xml-source.aspxRussel Loski, MCT
Free Windows Admin Tool Kit Click here and download it now
February 17th, 2011 12:30pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics