When you use multiple custom functions in a map definition and each custom function is defined in its own XML file in folder Artifacts\DataMapper\Extensions\Functions, the XSLT generation throws the below exception.
Both functions show up just fine in the designer, even after reopening the map:
Exception details:
Error message: correlationId='de2d5a40-829a-4f68-ab78-2ac881d8d81f', operationName='DataMapper.XsltCompiler.WriteCustomInlineFunctionsAsync', message='Error in processing custom functions definition from '<removed>\Artifacts\DataMapper\Extensions\Functions\function2.xml'.', exception='System.Xml.XmlException: 'name' is a duplicate attribute name.
at System.Xml.XmlWellFormedWriter.AddAttribute(String prefix, String localName, String namespaceName)
at System.Xml.XmlWellFormedWriter.WriteStartAttribute(String prefix, String localName, String namespaceName)
at Microsoft.Azure.Workflows.DataMapper.XsltCompiler.XslWriter.<>c__DisplayClass22_1.<WriteCustomInlineFunctionsAsync>b__2()', organizationId='', activityVector='IN.00', additionalProperties='{"ParentActivityId":"00-546dac1270d4b49905b16365e0059627-90a7ed06151b8c7d-00"}', extensionVersion='1.58.21.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='de2d5a40-829a-4f68-ab78-2ac881d8d81f'.
Error message: correlationId='de2d5a40-829a-4f68-ab78-2ac881d8d81f', operationName='ErrorResponseHandling.GetErrorResponseMessage.POST/RUNTIME/WORKFLOW/MANAGEMENT/', message='Http request failed with unhandled exception of type 'InvalidOperationException' and message: 'System.InvalidOperationException: The Writer is closed or in error state.
at System.Xml.XmlWellFormedWriter.AdvanceState(Token token)
at System.Xml.XmlWellFormedWriter.WriteEndElement()
at Microsoft.Azure.Workflows.DataMapper.XsltCompiler.XslWriter.WriteEndElement()
at Microsoft.Azure.Workflows.DataMapper.XsltCompiler.XslWriter.WriteFooter()
at Microsoft.Azure.Workflows.DataMapper.XsltCompiler.MapXsltGenerator.GenerateAsync()
at Microsoft.Azure.Workflows.Data.Utilities.DataMapper.DataMapperUtility.GenerateXslt(FlowConfiguration flowConfiguration, String mapContent, CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.Controllers.EdgeMapDesignerApiController.GenerateXslt(CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.BaseFlowExtensionRouteInitializer.Invoke(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionHttpRequestHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionAuthorizationHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionErrorResponseHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken)'.', exception='System.InvalidOperationException: The Writer is closed or in error state.
at System.Xml.XmlWellFormedWriter.AdvanceState(Token token)
at System.Xml.XmlWellFormedWriter.WriteEndElement()
at Microsoft.Azure.Workflows.DataMapper.XsltCompiler.XslWriter.WriteEndElement()
at Microsoft.Azure.Workflows.DataMapper.XsltCompiler.XslWriter.WriteFooter()
at Microsoft.Azure.Workflows.DataMapper.XsltCompiler.MapXsltGenerator.GenerateAsync()
at Microsoft.Azure.Workflows.Data.Utilities.DataMapper.DataMapperUtility.GenerateXslt(FlowConfiguration flowConfiguration, String mapContent, CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.Controllers.EdgeMapDesignerApiController.GenerateXslt(CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.BaseFlowExtensionRouteInitializer.Invoke(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionHttpRequestHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionAuthorizationHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Workflows.Web.Handlers.FlowExtensionErrorResponseHandler.HandleRequest(HttpRequestMessage request, CancellationToken cancellationToken)', organizationId='', activityVector='IN.00', additionalProperties='{"ParentActivityId":"00-546dac1270d4b49905b16365e0059627-90a7ed06151b8c7d-00"}', extensionVersion='1.58.21.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='de2d5a40-829a-4f68-ab78-2ac881d8d81f'.
Describe the Bug with repro steps
When you use multiple custom functions in a map definition and each custom function is defined in its own XML file in folder Artifacts\DataMapper\Extensions\Functions, the XSLT generation throws the below exception.
Both functions show up just fine in the designer, even after reopening the map:
Exception details:
Map definition:
Schema:
function1.xml:
function2.xml:
Screenshots or Videos
No response
Version
v2.119.4
Additional context
No response