private static XLANGMessage Transform(XlangMessageCollection messages, Type map, TrackingContext trackingContext, System.Xml.Xsl.XsltArgumentList arguments) { if (messages == null) { throw new ArgumentNullException("messages"); } if (messages.Count == 0) { throw new ArgumentException("XLangMessageCollection is empty.", "messages"); } if (map == null) { throw new ArgumentNullException("map"); } using (messages) { var resultContent = Transform(messages, map, arguments); var resultMessage = XlangMessage.Create(Service.RootService.XlangStore.OwningContext, resultContent); trackingContext.Apply(resultMessage); return(resultMessage); } }
/// <summary> /// Applies the XSL transformation specified by <paramref name="map"/> to the specified <paramref /// name="messages"/> collection and propagates the <paramref name="trackingContext"/> to the resulting message. /// </summary> /// <param name="messages"> /// The <see cref="XlangMessageCollection"/> to be transformed. /// </param> /// <param name="map"> /// The type of the BizTalk map class containing the transform to apply. /// </param> /// <param name="trackingContext"> /// The <see cref="TrackingContext"/> to be copied in the context of the output message. /// </param> /// <param name="arguments"> /// The arguments to pass to the XSL transformation. /// </param> /// <returns> /// The transformed message with the result in the first part (at index 0). /// </returns> public static XLANGMessage Transform(XlangMessageCollection messages, Type map, TrackingContext trackingContext, params XsltArgument[] arguments) { return(Transform(messages, map, trackingContext, new XsltArgumentList(arguments))); }