Workflow using Transform XML action to execute the XSLT. XSLT got 4 inline C# function. One function throwing the error. I cant see any issue with the XSLT and error message is not much help.
XSLT inline function
public string FormatDate(string inPutdate)
{
string formattedDate = string.Empty;
if (DateTime.TryParseExact(inPutdate, "yyyy-MM-dd", new System.Globalization.CultureInfo("en-GB"), System.Globalization.DateTimeStyles.None, out DateTime date))
{
formattedDate = date.ToString("yyyy-MM-dd");
}
return formattedDate;
}
Error :
[2025-06-12T18:39:15.493Z] XSLT is invalid ) expected
[2025-06-12T18:39:15.493Z] Result: XSLT is invalid ) expected
Exception: System.Xml.Xsl.XslLoadException: ) expected An error occurred at (291,158).
[2025-06-12T18:39:15.494Z] at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
[2025-06-12T18:39:15.495Z] at Microsoft.Azure.Workflows.BuiltIn.Xslt.NetFx.Providers.XsltNetFxBuiltInOperationsProvider.<GetProcessedXslt>d__30.MoveNext() in C:__w\1\s\src\functionWorkers\builtIn\BuiltIn.Xslt.NetFx\Providers\XsltNetFxBuiltInOperationsProvider.cs:line 258
Stack: at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
[2025-06-12T18:39:15.496Z] at Microsoft.Azure.Workflows.BuiltIn.Xslt.NetFx.Providers.XsltNetFxBuiltInOperationsProvider.<GetProcessedXslt>d__30.MoveNext() in C:__w\1\s\src\functionWorkers\builtIn\BuiltIn.Xslt.NetFx\Providers\XsltNetFxBuiltInOperationsProvider.cs:line 258.
[2025-06-12T18:39:15.579Z] Executed 'Functions.XsltNetFxLanguageWorkerFunction' (Succeeded, Id=0a230d4d-b43f-475a-a8a6-c9b6f749b0f0, Duration=721ms)
[2025-06-12T18:39:15.611Z] Job error: correlationId='152b3371-871a-4ea9-b75f-7231f3201a0c', operationName='XsltActionJob.ExecuteAction', jobPartition='7DA189ADF7C64464B5382F4B4F837413:2D08584518533325190132914236647CU00', jobId='08584518533325190132914236647CU00-INITIALIZE:3A5FMESSAGEID', message='XsltAction failed with handled exception.', exception='Microsoft.Azure.Workflows.Common.ErrorResponses.ErrorResponseMessageException: System.Xml.Xsl.XslLoadException: ) expected An error occurred at (291,158).
[2025-06-12T18:39:15.612Z] at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
[2025-06-12T18:39:15.613Z] at Microsoft.Azure.Workflows.BuiltIn.Xslt.NetFx.Providers.XsltNetFxBuiltInOperationsProvider.<GetProcessedXslt>d__30.MoveNext() in C:__w\1\s\src\functionWorkers\builtIn\BuiltIn.Xslt.NetFx\Providers\XsltNetFxBuiltInOperationsProvider.cs:line 258
[2025-06-12T18:39:15.614Z] at Microsoft.Azure.Workflows.Languages.Edge.NetFx.Engines.NetFxRuntimeEngine.RunNetFxWorkerFunction(String functionName, JToken input, CancellationToken cancellationToken)
[2025-06-12T18:39:15.615Z] at Microsoft.WindowsAzure.ResourceStack.Common.Extensions.AsyncExtensions.ThenTInput,TOutput
[2025-06-12T18:39:15.616Z] at Microsoft.Azure.Workflows.Worker.Jobs.XsltActionJob.<>c__DisplayClass10_0.<<ExecuteAction>b__0>d.MoveNext()
[2025-06-12T18:39:15.616Z] --- End of stack trace from previous location ---