Hello,
I'm seeing the spaces at the beginning of the parameter in the logs but if I copy and paste that value from the logs into the business function to test directly, it fails. The spaces appear to be there but they aren't being recognized by the business function. If I take out those copied spaces and use the spacebar to enter the same amount in the business function I get the expected result.
I used the   special character for my spaces so that may be the problem.
Does anyone have experience padding a value with spaces to the left and seeing success with the JDE business functions? I pasted the parameter with "8 SPACES HERE" where I was trying the special characters as well as just typing the spaces.
<param name="szBranchPlant"><xsl:text>8 SPACES HERE</xsl:text><xsl:value-of select="/WorkData/_ViewParameters/FromBranch"/></param>
Thanks!
Spaces not recognized by JDE Business Function from XML
-
- Posts: 1
- Joined: October 28th, 2021, 9:56 am
- Contact:
-
- Posts: 329
- Joined: August 26th, 2021, 9:18 am
- Contact:
Re: Spaces not recognized by JDE Business Function from XML
There are a few different ways you can accomplish this.
1. Use PadLeft service
Use the output in the business function.
2. Use XSLT
There are a few ways to do this
a.
using pure vanilla xslt
b.
using EASYProcess Custom xslt function
1. Use PadLeft service
Code: Select all
<PadLeft>
<Convert>
<Data IsArray="True" Index="1">
<Name>BranchPlant</Name>
<Value>
<xsl:value-of select="WorkData/_ViewParameters/FromBranch"/>
</Value>
<Length>8</Length>
<Character> </Character>
</Data>
</Convert>
</PadLeft>
Code: Select all
<xsl:value-of select="WorkData/PadLeft/Output/BranchPlant"/>
2. Use XSLT
There are a few ways to do this
a.
using pure vanilla xslt
Code: Select all
<xsl:value-of select="substring(' ',1,12-string-length(WorkData/_ViewParameters/FromBranch))"/><xsl:value-of select="WorkData/_ViewParameters/FromBranch"/>
using EASYProcess Custom xslt function
Code: Select all
<xsl:value-of select="EASYProcess:PadLeft(WorkData/_ViewParameters/FromBranch,12,' ')"/>
word count: 120