locked
FlatFile Schemas with (Invalid?) XML RRS feed

  • Question

  • Hello. I'm completely new to BizTalk. I just completed a course on the basics, and I'm experimenting with some real-world stuff now. I'm looknig at a vendor file layout that I'm not sure how to handle. There are two issues:

    1. It's flat-file data with embedded XML. That is, they have an XML schema, but there are many (sometimes up to 600) XML documents in a single text file. Before each report there is a one-line positional header.

    2. The XML schema is technically valid, but not in Visual Studio. I figured out that two node names have dashes, and need to be renamed with underscores.

    My questions are as follows:

    1. How can I create a BizTalk schema based on this? Any examples in the training were either XML, flat-file or EDI, not a mixture. Do I just use the XML schema and somehow specify that there are multiple instances? or do I create a header schema for the flat-file header, and then use the existing XML schema?

    2. What about the invalid node names? If I rename the nodes, they'll never match the incoming data, but if I don't rename them, the schema is invalid.

    Has anyone encountered this before? If so, I would love to know your thoughts on this. Thanks!

    Monday, May 2, 2011 10:56 AM

Answers

  • Hi,

    You need to write a custom pipeline component to do some preprocessing on the incoming message. You then use the pipeline component in a custom pipeline in a receive location. The pipeline compont should:

    - remove the dashes from the xml node names

    - remove the non xml stuff from the file and enclose it in a root tag.
      or
      disassemble the xml parts from the file into seperate messages.

    This is probably not the easiest thing to do, especially if you're new to BizTalk. So another option would be to ask the vendor to deliver valid and well formed XML instead of the file you get now.

     


    HTH,

    Randal van Splunteren 2 x MVP BizTalk Server, MCTS BizTalk Server
    my blog

    Check out the PowerShell provider for BizTalk
    Please mark as answered if this answers your question.
    • Marked as answer by Kris Mehta Wednesday, May 18, 2011 10:52 AM
    Monday, May 2, 2011 11:27 AM
    Moderator

All replies

  • Hi,

    You need to write a custom pipeline component to do some preprocessing on the incoming message. You then use the pipeline component in a custom pipeline in a receive location. The pipeline compont should:

    - remove the dashes from the xml node names

    - remove the non xml stuff from the file and enclose it in a root tag.
      or
      disassemble the xml parts from the file into seperate messages.

    This is probably not the easiest thing to do, especially if you're new to BizTalk. So another option would be to ask the vendor to deliver valid and well formed XML instead of the file you get now.

     


    HTH,

    Randal van Splunteren 2 x MVP BizTalk Server, MCTS BizTalk Server
    my blog

    Check out the PowerShell provider for BizTalk
    Please mark as answered if this answers your question.
    • Marked as answer by Kris Mehta Wednesday, May 18, 2011 10:52 AM
    Monday, May 2, 2011 11:27 AM
    Moderator
  • Thanks for the swift reply, Randal. I'll look into custom pipelines.

    Monday, May 2, 2011 12:25 PM
  • I've looked into creating a custom pipeline, but it seems to crash BizTalk. (I have to stop the service.) Either that, or it does not recognize the file. I can't seem to find examples anywhere on how to create a pipeline to remove or isolate the header. Can anyone give me some pointers?

    Basically, the data in the text file looks like this

    HDRblablablablabla
    <MVR>
    <someNode>
    <someOtherNode>
    </MVR>

    ...and that sequence repeats a few hundred times. I have a schema for the XML portion, but I need to split it into individual messages and isolate the HDR line. (I'd actually like to keep the HDR line, but if removing it works better, that would be acceptable.

    Any ideas?

    Tuesday, May 3, 2011 11:37 AM
  • Can you post the code for the custom pipeline component so I/we can have a look?

     

     

     


    HTH,

    Randal van Splunteren 2 x MVP BizTalk Server, MCTS BizTalk Server
    my blog

    Check out the PowerShell provider for BizTalk
    Please mark as answered if this answers your question.
    Tuesday, May 3, 2011 11:53 AM
    Moderator
  • I didn't write any code. I just dragged disassembler shapes to the disassemble stage. I tried two flat-file disassemblers, with one specifying a header schema, as I saw in one example, and then I tried an XML disassembler with an envelope schema.

    Tuesday, May 3, 2011 12:34 PM
  • Hi, Kris

    ->"1. How can I create a BizTalk schema based on this?"
    This document could be helpful to you:
    http://msdn.microsoft.com/en-us/library/aa577898(v=BTS.20).aspx

    After you have extracted the xml files, place these xml files in a file location where biztalk can access to. BizTalk pick up xml files base on the predefined schema.

    ->"2. What about the invalid node names? If I rename the nodes, they'll never match the incoming data, but if I don't rename them, the schema is invalid."
    How about treating file as flat file first, and then replace the invalid node with correct chars.

    Regards

    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Monday, May 9, 2011 7:03 AM
    Moderator