vik.patil
24th June 2017, 01:39
Hi All,
We are working on integration of EAM with LN10.5 and facing issues with one of the Incoming BOD(SourceSystemJournal) which is giving error for 2 fields Accounting Entity and Location.
Infor recommend that we need to include these 2 values in inbound BOD using XSLT Mapping. May I know how to use xslt mapping to add these 2 field in incoming BOD so that we will get all BOD's without any error.
Any help appreciated
Regards,
Vikram Patil
bhushanchanda
26th June 2017, 13:20
You can just do a google search on "How to add elements using XSLT" and you will find many online resources with sample code snippets to do it.
Just edit and use them to add whatever you need.
Here is an example. (https://stackoverflow.com/questions/3649195/adding-element-in-middle-of-xml-using-xslt)
vik.patil
27th June 2017, 06:47
Thanks Bhushan.
I got information on how to add field using XSLT. Now when I have added code to add new fields which is working fine if source xml doesn't have namespace xmlns="http://schema.infor.com/InforOAGIS/2" in source XML File.
Following is code I am using as XSLT:
xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@* | node()" name="identity-copy">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="DataArea/Process">
<xsl:copy>
<xsl:apply-templates select="@* | *"/>
<AccountingEntityID>201</AccountingEntityID>
<LocationID>S_201</LocationID>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
This code works if Source XML doesn't have xmlns="http://schema.infor.com/InforOAGIS/2" and with this namespace we are not able to add new columns in xml file to pass it to LN.
Please let me know anything missing in XSLT Code
Regards,
Vikram
bhushanchanda
27th June 2017, 07:21
You will need to bind the custom namespace to a variable and then use it to insert your elements. Check this link (https://stackoverflow.com/questions/12992245/how-to-add-namespace-and-prefix-for-all-elements-and-attributes-using-xslt)
vik.patil
9th July 2017, 02:07
Thanks for suggestions. I am able to fix this issues. I have added name space as
xmlns:bod="http://schema.infor.com/InforOAGIS/2" and modified match template as <xsl:template match="//bod:DataArea/bod:Process">.
Regards,
Vikram