none
Custom XSL file in a map

    Question

  • I came a cross a nice article written by Chris configures regarding configuring Custom XSL file inside a map which allows overriding the XSLT for a BizTalk map by configuring "Custom xsl path" property to indciate an external xsl file.

    I setup an application with necessary receive location and port, configured to use the map, then a send port. Whenever I drop a file in the input directory, I get exactly the same data (flat file) as if mapis not applied. Is there any other config to be done in order to get map executed.
    Thanks
    Sunday, March 14, 2010 12:35 PM

Answers

All replies

  • Does the MessageType of the file match the input schema tyep of the map?
    Sunday, March 14, 2010 1:42 PM
  • Yes sir, as Inside Visual studio, when I do  "testing map", validate instance gives expected outcome
    Sunday, March 14, 2010 3:00 PM
  • I believe you missed the map settings at send port level.


    Thanks, Raja
    Sunday, March 14, 2010 3:05 PM
  • No Sir, Outbound Maps is configured to use the map. I tried both at rloc level and send port
    Sunday, March 14, 2010 5:19 PM
  • Can you check which pipeline you are using? It needs to be XML or your custom pipeline if you have.


    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    Sunday, March 14, 2010 5:23 PM
  • I am using passthrough pipline. When I use xml pipline, the message is suspended withe following error :

    There was a failure executing the send pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLTransmit, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML assembler" Send Port: "sportGroupingAndSortingFile" URI: "E:\tutorial\Romp.BizTalk.MapTest\Out\Grouped-Order%MessageID%.xml" Reason: Data at the root level is invalid. Line 1, position 1.

    Instance I am using i generated and validated inside VS, as I said, when I test the map inside VS, transformation output is correct

    Sunday, March 14, 2010 5:28 PM
  • I believe you have to use custom flatfile disassembler component.
    http://www.biztalkgurus.com/forums/t/6009.aspx
    Thanks, Raja
    Sunday, March 14, 2010 5:41 PM
  • Hi Eliassal, 

    I haven't looked the URL of the article you are referring.. (can you provide the URL please?)

    Just to check, have you ever converted the flat file message to XML document or using any Orchestration? By the error, I guess that the input message to map doesn't look like valid XML message.  

    Just found a similar old post, It might be helpful to you.. : http://social.msdn.microsoft.com/Forums/en-NZ/biztalkgeneral/thread/f09746f2-dd3f-48e8-902e-410d9a9c5bc3
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    Sunday, March 14, 2010 5:55 PM
  • I am a little bit confused. According to eliasen,
    "The map is executed BEFORE the send pipeline. The pipeline usually converts the output of the map into the needed format of the receiver, such as a flat file instance. This in turn means that the map ALWAYS exxecutes - if the MEssageType matches - despite of what pipeline is chosen.

    map should be executed.

    Now, it is true, when I check the contents in BTS hub, I see the flat file content, not transformed to xml format. So should or should not use a custom flat file pipeline at the receive port?
    Thanks
    Sunday, March 14, 2010 6:12 PM
  • I created a new pipeline with FF disassembler, configured Receive location to use it, then configured Send port to use xmltransmit, it worked, map executed
    Sunday, March 14, 2010 6:18 PM
  • If you are using Passthrough pipeline in receive side then biztalk doesn't consider the MessageType. 

    As you said, if your tracked message is still flat file, I suggest either to use XML Transmit, or your Custom pipeline so that the received flat file gets converted into XML before publishing to the MessageBox. 

    Also, How you are creating subscription on the send port?

    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    Sunday, March 14, 2010 6:24 PM
  • Mohan, I think we should use a FF pipeline. Do you want to suggest that we can use a passthrough in receive location for the falt file, then use xml transmit or custom send pipeline on the send port?
    I think I have already tried passthrough on Rec location, xml transmit on send port but it didn't work.
    Is my understanding is good?

    Sunday, March 14, 2010 7:49 PM
  • You have to use flat file disassembler at receiving side and use XML transmit at send side. You should be fine.

    Thanks, Raja
    Sunday, March 14, 2010 8:36 PM
  • Sorry eliassal for to confusion, I mean to say XML Transmit/or your Custom Pipeline component pipeline Receive side so that your message will be promoted with its type by converting into XML before publishing to the message box.


    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    Sunday, March 14, 2010 8:41 PM
  • What happened here then is that you had a flat file on the way in but was using the passthrough pipeline on the receive location. This would not have transformed the flat file into its xml version and neither would have promoted the message type. On the send port you probably had the filter set to BTS.ReceivePortName wich did route the message to it, but since the message type was not promoted the map on the send port (or receive location by the way) didn't get applied.

    For the order in which things happen on receive ports and send ports:
    http://connectedthoughts.wordpress.com/2009/04/17/order-of-map-and-pipeline-execution-in-biztalk-ports/

    Regards,
    Thiago


    Thiago Almeida - http://connectedthoughts.wordpress.com
    Sunday, March 14, 2010 8:56 PM
    Answerer
  • Absolutly, this is what is learned, there should be a custom FF at rloc. Thiago, I am wondering why MS doesn't provide out of the bow a pipeline that can be configured with its document type inside the Receive and send ports, just like the 2 other pipelines provided (passthrough and xmlreceive)...

    Thanks for all of you
    Sunday, March 14, 2010 9:07 PM
  • The reasons I can thing of are that:
    - The passthrough pipeline doesn't do anything with the message, it's an 'empty' pipeline. All settings are optional.
    - The XmlReceive pipeline is able in a lot of cases to determine the schema for the message without the need of any changes, it inspects the XML message and looks for the schema related to it. The properties to tell the XmlDisassembler what schema to use is optional.

    With the flat file disassembler component on the other hand you need to configure it with the specific schema that relates to the files coming in. It's not as clever as the XML disassembler. And the parameters are not optional. So I guess Microsoft never bothered with creating one out of the box flat file pipeline that is not configured.

    Regards,
    Thiago
    Thiago Almeida - http://connectedthoughts.wordpress.com
    Monday, March 15, 2010 3:26 AM
    Answerer
  • I always create a common assembly containing a generic flat file send and recieve pipeline.
    You need to specify the document spec on the receive pipeline to build the pipeline so I create a generic flat file schema that is used to build the pipeline and then this can be overridden in per instance config 
    On the send pipeline the the flat file assembler will use the message type on the outgoing message to establish the document spec.

    This saves creating inummerable flat file pipelines, one for each flat file schema.
    Monday, March 15, 2010 9:47 AM
    Answerer
  • Hi,

     

    Both solutions work well:


    Deploy the schemas and map into a BizTalk application, and then:

    • Create new ReceivePort (one-way) ex: ReceivePortMG

            o   New Receice Location: Type: FILE, Receive pipeline: XMLReceive

            o   Inbound Map: config the map, In my case

            §  Source: InputOrder

            §  Map: MapOrder

            §  Target: OutputOrder

    • Create SendPort (static one-way): Type: FILE, Send pipeline: XMLTransmit

            o   Apply a filter to the send port

            §  Property: BTS.ReceivePortName

            §  Operator: ==

            §  Value: ReceivePortMG

    Start the ports.

    You don’t need to create a new pipeline to use this solution.

     

    This is my solution: http://cid-98a008f39b7bbf8e.skydrive.live.com/self.aspx/.Public/MuenchianGroupingMSIadnBinding.zip
    Sandro Pereira - http://sandroasp.spaces.live.com/blog/ http://www.devscope.net/WhatWeDo/Integration/tabid/107/Default.aspx
    Monday, March 15, 2010 11:32 AM
    Moderator
  • Thanks Sandro, I figured late that your solution used xml input file. I thought while reading your artcile about Chris, that you were using a flat file like him. Correct, using the steps you mentioned your solution works like a charm. However, for Chris's solution as I said, we should have a FF pipeline

    Thanks for your response

    Monday, March 15, 2010 5:42 PM
  • Greg, this was what I was wondering about. Why don't we have something out of the box like your solution. I know that it is not so difficult to do it, but for a beginner it might be difficult to find and do.
    Monday, March 15, 2010 5:44 PM
  • Thanks Greg - as I was writing the reply I thought one could create 'generic' receive and send flat file pipelines that can be shared throughout the environment but always need to be configured on a per instance basis. Good to know you already implement that, will keep it in mind.
    Thiago Almeida - http://connectedthoughts.wordpress.com
    Monday, March 15, 2010 6:19 PM
    Answerer
  • Hi,

     

    Both solutions work well:


    Deploy the schemas and map into a BizTalk application, and then:

    • Create new ReceivePort (one-way) ex: ReceivePortMG

    o New Receice Location: Type: FILE, Receive pipeline: XMLReceive

    o Inbound Map: config the map, In my case

    § Source: InputOrder

    § Map: MapOrder

    § Target: OutputOrder

    • Create SendPort (static one-way): Type: FILE, Send pipeline: XMLTransmit

    o Apply a filter to the send port

    § Property: BTS.ReceivePortName

    § Operator: ==

    § Value: ReceivePortMG

    Start the ports.

    You don’t need to create a new pipeline to use this solution.

     

    This is my solution: http://cid-98a008f39b7bbf8e.skydrive.live.com/self.aspx/.Public/MuenchianGroupingMSIadnBinding.zip
    Sandro Pereira - http://sandroasp.spaces.live.com/blog/ http://www.devscope.net/WhatWeDo/Integration/tabid/107/Default.aspx

    What you shared helps solve my problem, Thanks for your reply!
    Sunday, January 16, 2011 11:54 PM