Thursday, February 11, 2010

Adding an xml-stylesheet reference (or comment) to your XML file in BizTalk

A collegue of mine asked for help in adding a stylesheet reference declaration to an outgoing XML-file in BizTalk. The XML looked something like this:

<xml version="1.0" encoding="utf-16"?> 
<ns0:Report xmlns:ns0=http://www.customer.se/schema/System/ReportSchema_1.1>
 
<ns0:Identification> …



But the desired output had this additional element declaring an xml-stylesheet.

<xml version="1.0" encoding="utf-16"?> 
<xml-stylesheet type="text/xsl" href="System_ReportSchema_1.1.xslt"?> 
<ns0:Report xmlns:ns0=http://www.customer.se/schema/System/ReportSchema_1.1>
 
<ns0:Identification> …


The solution was to add the element to the XmlAsmProcessingInstructions in the XML pipeline properties in the send port. This property can also be used to add additional data that you want to add to your message, such as comments.


See http://msdn.microsoft.com/en-us/library/aa578687(BTS.20).aspx for more information.

No comments:

Post a Comment