Hello,
I use in Job's X++ code XSLT transformation. XSLT file contains also XSLT's functions.
How these functions should be declared in AX 2009 XSLT file because e.g when using replace function a running job gives a error message:
'replace()' is an unknown XSLT function.
X++ code is following:
xmlDoc = new XmlDocument();
xmlDoc.loadXml(aifXMl);
xslDocument = new XmlDocument();
xslDocument.load(@"C:\Data\Transform.xsl");
xmlTransfornedDoc = XSLFileTransform.transformXmlDocument(xmlDoc, xslDocument);
and in XSL file
<OrganisationUnitNumber>
<xsl:variable name="OVT" select="doc:MyDocs/doc:Invoice/doc:Code"/>
<xsl:choose>
<xsl:when test="contains($OVT, '-')">
<xsl:value-of select="concat('0088', replace($OVT,'-',''))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('0088', $OVT)"/>
</xsl:otherwise>
</xsl:choose>
</OrganisationUnitNumber>
In XSLT editor environment this works well.
Best Regards,
Michael