Page 1 of 1

Spaces not recognized by JDE Business Function from XML

Posted: July 17th, 2023, 10:37 am
by NeisesJ
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!

Re: Spaces not recognized by JDE Business Function from XML

Posted: July 25th, 2023, 9:21 am
by SteveCap
There are a few different ways you can accomplish this.

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>&#160;</Character>
		</Data>
	</Convert>
</PadLeft>
Use the output

Code: Select all

<xsl:value-of select="WorkData/PadLeft/Output/BranchPlant"/>
in the business function.

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"/>
b.
using EASYProcess Custom xslt function

Code: Select all

<xsl:value-of select="EASYProcess:PadLeft(WorkData/_ViewParameters/FromBranch,12,' ')"/>