on 05-09-2013 5:41 PM
Hi,
I have PI 7.1
Sender - PI (XSLT map) - Receiver
In XSLT map , i have to remove apostrophe from the ItemNode (Element of Source message) value-
<xsl:variable name="specialCharacters" select="'&apos'"/>
<xsl:value-of select="translate(ItemNode, $specialCharacters, '') "/>
But this is failing in SAP PI.
Even when i am testing it in XSLT mapping tool - Its giving error that XSLT is not correct.
Error:XSLTProcessor::transformToXml() [<a href='xsltprocessor.transformtoxml'>xsltprocessor.transformtoxml</a>]: No stylesheet associated to this object
How to remove apostrophe using XSLT map in PI.
Rgds
Hi,
For xslt 1.0
<xsl:value-of select='translate(ItemNode, "'", " ")'/>
or
<xsl:variable name="apos">'</xsl:variable>
<xsl:value-of select="translate(ItemNode, $apos, ' ')"/>
Thanks,
Aman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"But I think apostrophe can't be removed in PI XSLT message mapping."
PI XSLT message mapping??
If you are using XSLT mapping then no need to create MM.
MM is basically a Graphical Mapping editor.
For XSLT-
write your XSLT code, zip it, then import as Imported Archive
Create an OM, select that imported IA and test it.
FYI-
It is working fine for me, below is the snapshot of successful test run in OM.
in the field KEY apostrophe value is coming, which is mapped to dummy field in the Target structure and apostrophe is removed by alphabet 'd'.
I used the same snippets what I shared with you.
Thanks,
Aman
Hi,
Although XSLT is also an option, but you can do this in Graphical/Java mapping by using replaceString function.
Apostrophe should be ' and not just &apos
In XSLT it should work like as below:
<xsl:for-each select="ItemNode">
<xsl:value-of select=" replace(current(),'&','')"/>
Hope it works.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for reply.
But I think apostrophe can't be removed in PI XSLT message mapping.
Runtime exception occurred during application mapping com/sap/xi/tf/msg_mapping_name; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Element type "input" must be followed by either attribute specifications, ">" or "/>"
Anyother suggestion.
Regards
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.