
Good day all
We have created an outbound port in Dynamics Ax 2012 R3 to send financial data to an external system. We are using a file system adapter to insert the file into a test directory at the moment. I have written an outbound transform (XSL) to transform the XML generated by the document service to a text file. We are required to produce a TSV (tab separated value) file. The data is being extracted from Ax correctly BUT in the text file produced, all white spaces (tabs and spaces between values) have been removed even though they show properly when I test the transform in Visual Studio or Internet Explorer. I will post a sample xml file and the xsl below. Any advice regarding how to prevent these spaces from being ignored/removed would be greatly appreciated.
Thanks in advance
Stephen
XML sample:
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="testXSL.xsl"?> <Envelope xmlns="schemas.microsoft.com/.../Message"> <Header> <MessageId>{3AB26E75-E4DA-4B42-B708-359A9057272F}</MessageId> <Action>tempuri.org/.../find</Action> </Header> <Body> <MessageParts xmlns="schemas.microsoft.com/.../Message"> <IMXAifI060 xmlns="schemas.microsoft.com/.../IMXAifI060"> <DocPurpose>Original</DocPurpose> <SenderId>sam</SenderId> <CustInvoiceJour class="entity"> <_DocumentHash>038f6e2051a3b77986cbba07ed1a3b7e</_DocumentHash> <CustGroup>Default</CustGroup> <InvoiceAccount>SAM-000004</InvoiceAccount> <InvoiceAmount>48.00</InvoiceAmount> <InvoiceDate>2016-03-11</InvoiceDate> <InvoiceId>SAM-000047</InvoiceId> <InvoicingName>Heraeus</InvoicingName> <NetAmount>48.00</NetAmount> <Qty>49.000</Qty> <RecId>5637168644</RecId> <XMLDocPurpose>Original</XMLDocPurpose> <CustTable class="entity"> <AccountNum>SAM-000004</AccountNum> <CustGroup>Default</CustGroup> <Name>Heraeus</Name> <Party>000000016</Party> <RecId>5637146076</RecId> <DirPartyTable xsi:type="AxdEntity_DirPartyTable_DirOrganization" class="entity" xmlns:xsi="www.w3.org/.../XMLSchema-instance"> <Name>Heraeus</Name> <PartyNumber>000000016</PartyNumber> <RecId>5637149827</RecId> </DirPartyTable> </CustTable> </CustInvoiceJour> </IMXAifI060> </MessageParts> </Body> </Envelope>
XSL sample:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="www.w3.org/.../Transform" xmlns:i="schemas.microsoft.com/.../Message" xmlns:j="schemas.microsoft.com/.../IMXAifI060" xmlns:k="www.w3.org/.../XMLSchema-instance"> <xsl:output method="text" encoding="utf-8"/> <xsl:variable name="tab"> <xsl:text>	</xsl:text> </xsl:variable> <xsl:variable name="cr"> <xsl:text> </xsl:text> </xsl:variable> <xsl:template match="/"> <xsl:for-each select="//j:CustInvoiceJour"> <xsl:value-of select="concat(substring(./j:InvoiceDate, 1, 4), $tab)"/> <xsl:value-of select="concat(./j:CustTable/j:Party, $tab)"/> <xsl:value-of select="concat(./j:CustTable/j:DirPartyTable/j:Name, $tab)"/> <xsl:value-of select="concat(./j:CustGroup, $tab)"/> <xsl:value-of select="concat(./j:InvoiceId, $tab)"/> <xsl:value-of select="concat(./j:InvoiceDate, $tab)"/> <xsl:value-of select="concat(./j:InvoiceAmount, $tab)"/> <xsl:value-of select="concat('0', $cr)"/> </xsl:for-each> </xsl:template> </xsl:stylesheet>
*This post is locked for comments
I have the same question (0)