on 02-13-2009 6:56 PM
Hi,
How can I remove the leading Zeroes in every Filed I have in whole Payload Structure.there are around 10000 fields that have to be removed the leading Zeroes.any good idea please.
<POSNR>000010</POSNR>
<MATNR>000002465640</MATNR>
<ARKTX>000012 KG D107</ARKTX>
<MATKL>00030010000</MATKL>
<WERKS>0000ORGC</WERKS>
<LGORT>0000GC55</LGORT>
<CHARG>000TEST</CHARG>
like this mutliple segments and multiple Fields.so I can take as whole payload with multiple fields should not have leading Zeroes.I can handle if they are 10 0r 20 fileds,but not like whole pay load/1000 fields right.
thank you,
Prem
Hi
You can have an additional XSLT mapping, to your existing one..
use copy-of & apply-templates to copy the whole tree & make changes recursively.
below is a sample code , the marked line is where you need to try your logic of trimming Zeros. (this code does upper case)
add this below code in your interface mapping object, as XSLT mapping, which does the job (only try putting your logic)
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="xml"
indent="yes"
omit-xml-declaration="yes"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="upper-case(.)"/>
</xsl:template>
</xsl:stylesheet>
hope this fixes your issue
Regards
Vishnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prem,
You can use the FormatNumber function to remove the leading zeros. But this is to be used for each individual field.
Regards,
Hari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.