none
Combine multiple different xml documents into one? RRS feed

  • Question

  • Hi, I'm new to XML and SSIS, trying to create some XML files according to a specification that was handed to me.

    Basically it's five base-documents that I create from different tables in a database, but I have no idea how to create the sixth document. It should be a "complete" document based upon the five others. The structure of the documents are:

    File1.XML
    <File1Root>
    <ChildFile1>...</ChildFile1>
    </File1Root>

    File2.XML
    <File2Root>
    <ChildFile2>...</ChildFile2>
    </File2Root>

    File3.XML
    <File3Root>
    <ChildFile3>...</ChildFile3>
    </File3Root>

    File4.XML
    <File4Root>
    <ChildFile4>...</ChildFile4>
    </File4Root>

    File5.XML
    <File5Root>
    <ChildFile5>...</ChildFile5>
    </File5Root>

    The sixth document should be structured:

    <EveryFile>
      <File1Root>
        <ChildFile1>...</ChildFile1>
      </File1Root>
      <File2Root>
        <ChildFile2>...</ChildFile2>
      </File2Root>
      <File3Root>
        <ChildFile3>...</ChildFile3>
      </File3Root>
      <File4Root>
        <ChildFile4>...</ChildFile4>
      </File4Root>
      <File5Root>
        <ChildFile5>...</ChildFile5>
      </File5Root>
    </EveryFile>
    

    How can I create the sixth file from SSIS, based upon the five I have managed to create from the tables?

     

    Thanks folks!
    k

    Friday, May 6, 2011 1:43 AM

Answers

  • There is no out-of-the-box task that can help you with this. You have to program a script.

    If you can use third-party solutions, I would recommend you check CozyRoc Template Task. It is designed to solve problems like the one you have described and more. You can generate the complete specification document in one place, by specifying ASP-like layout of your document and then connecting your layout to different elements (connections, variables, data flows) in SSIS.


    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/
    Friday, May 6, 2011 12:09 PM