on 10-12-2012 1:29 PM
Hello,
I had to add a trailer space to one of the field at the end to be sent out as an EDI.(Seeburger).
For example the value is "7" i need to send it as "7_" where the underscore should be just a space.
How do I do that in XI, when I add it through the map i do see in the test run but do not see it in the actual EDI file generated.Some where it's getting lost, I know that it's an XML property but is there a way it could be added and send in this way?
PI 7.0 SP15
Let me know your thoughts.
Thanks in advance!
Larry.
If you want to have a field, which is filled with spaces from right side just do the following:
1. Concatenate our field with constant like " ]"
2. Substring the result to legnth required
That's all Folks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Larry,
I agree with the previous speakers that such behaviour is a characteristic of the XML standard. Whenever I have such doubts, I always refer to the XML specification by W3C. Here is what is says about the extra spaces and white space handling in general:
http://www.w3.org/TR/REC-xml/#sec-white-space
Here are the two possiblities that I would try out:
1. If you received the format specification from the receiver system (such as an .xsd file), you can add the xml:space preserve attribute to this schema manually and reimport it to PI (or ask the receiver to do it for you).
2. Another option (if you defined the receiver structure manually in PI) is to set the minLength of the XML node discussed. This could also help preserving the extra spaces.
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg,
I have a similar kind of requirment where the whitespace are getting trimmed when it get processed in PI.
currently xml is from MQ (JMS) -- > PI -- ECC, where in a segmnet has the field as below
<FIELD2>0299 N 23487 02 00N 0.00 </FIELD2>
and the output is
<FIELD2>0299 N 23487 02 00N 0.00 </FIELD2>
but I need to maintain the same format till it reaches ECC , as there is a validationg based on this format.
can I have your input.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since you use pi 7.0 which supports only jdk 1.4 you cannot use String's method format in your case.
Please use this link for creating udf to pad empty space in the string.
http://www.java2s.com/Code/Java/Data-Type/RightpadaStringwithaspecifiedString.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Leading and trailing spaces might be removed by the edi logic at run time. Somewhere the string method trim might have been used to remove the empty trailing spaces. If that's so, you might talk to the target system to send some characters at the end instead of empty space. You can use the same constant or the above udf logic for the same.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.