XML Source missing elements

  • Hello,

    I am currently experiencing a problem with XML Source and the way it is handling our XML files. It seems to be ignoring the CompanyId and CustomerId elements. If I move the children of PurchaseOrderNotificationDetails into the same parent of CompanyId and CustomerId, and remove the PurchaseOrderNotificationDetails parent, it will work. However I don't want to have to spend much time manipulating the XML.

    Has anyone else had problems with this or know how to resolve the problem?

    Many thanks,

    Ashley.

  • can you control how the xml is handled using the xsd document? perhaps you could specify how to handle white space using this?

    tom

    Life: it twists and turns like a twisty turny thing

  • Thanks Tom for your reply.

    I have attached the XSD that was generated from within the XML Source Editor. Could you please elaborate on what you mean about the whitespace? I wouldn't have thought it would cause a problem?

  • Perhaps I misunderstood your first post. I thought you were having problems with spaces.

    It seems to be ignoring the , it works.

    Could you clarify for me what is being ignored?

    Thanks,

    Tom

    Life: it twists and turns like a twisty turny thing

  • Sorry, it seems the elements get converted to whitespace after I psot the reply.

    The elements that get ignored are CompanyId and CustomerId, so the only elements that seem to be parsed are the children of PurchaseOrderNotificationDetails.

    Regards.

  • from MSDN:

    The XML source generates tabular structures from the XML data by creating an output for every element that contains other elements in the XML files

    As your company and customer ID elements don't contain any elements of their own, then an output for them will not be created.

    If you put them in a wrapper element (see attachments), then two outputs will be created.

    Tom

    Life: it twists and turns like a twisty turny thing

  • Thank you Tom for your example, however this did not resolve the problem. Are there any settings or options that I should have enabled/disabled?

  • i don't think so; i just used the xml source straight out of the box.

    what happened when you used the files i included?

    tom

    Life: it twists and turns like a twisty turny thing

  • Hello Tom,

    I was in the process of taking screenshots to show you what the outputs were, and then I noticed a second output connection (green one), so I figured that there is an output connection for each node of the XML file. I then used a 'Union All' task to connect all the columns together so it could be inserted into the database.

    However, the only problem with is that because these XMLs are coming in from another destination, we cannot modify them, therefore we cannot add the IDs node and I would need to use a stylesheet to create the node around the CompanyId and CustomerId. Once the stylesheet is created and used with the 'XML Task', would this work?

    I'll need to have a look around for some stylesheet tutorials.

    Many thanks.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply