on 02-05-2009 1:24 PM
Hi there.
Just a question regarding the addition of a tag header in an XML file please?
Idoc - > XI -> file (XML File)
We have a need to add something like this below in bold to XML Tag Header in the inbound file:
<?xml version="1.0" encoding="UTF-8"?>
<?POSTEN SND="SE03220037090" SNDKVAL="1" REC="SE03220669500"
MSGTYPE="ORDERS"?>
Any ideas on how this can be managed would be apreciated please?
Thank you.
Mick.
Hi Michael,
With some knowledge of java you can create an adapter module and change whatever you want in xml file! You can for example insert new information in header!
In addition, inside adapter module you can log and monitor what happens!
If you need any help contact me I can send you an example! It's very easy !!!
Regards!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carlos.
Thanks for your reply. I like what you are suggesting, however, I have no knowledge of Java and how to implement this Java addition to the mapping interface.
I would appreciate any hints you may have. The value that I am trying to add to the tag header is exactly as it is below(the value in bold) and it can in fact be fixed, i.e. I am not looking to dynamically determine the values in the additional tag but just add the value as it is below...
<?xml version="1.0" encoding="UTF-8"?>
<?POSTEN SND="SE03220037090" SNDKVAL="1" REC="SE03220669500"
MSGTYPE="ORDERS"?>
I would appreciate any input from you on that.
Thanks in advance Carlos.
Mick.
Use following XSLT mapping. If you have already a maping, put that XSLT in a sequence mapping as second mapping step.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="/">
<!-- add processing instruction -->
<xsl:processing-instruction
name="POSTEN">SND="SE03220037090" SNDKVAL="1" REC="SE03220669500" MSGTYPE="ORDERS"</xsl:processing-instruction>
<!-- copy payload -->
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
Regards
Stefan
....Just wonderring would it be a big deal / change on the XSLT if I was required to pass say the IDoc number of file into the REC field of the Tag Header or have XI pass a unique ID into this field if it were required?
(The term "Give an inch...take a mile" comes to mind when I am asking this so do not worry if this is not an easy question to answer, then leave it..)
Thanks again for the original solution...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Stefan / Carlos.
Solution works like a dream.
Lifesavers!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Michael,
As you can see, XI provide many ways to solve the same problem !!!
I don't know if you already solved the problem but Stefan posted a perfect solution for you!
Just upload the xslt mapping file and add a new mapping step in your message mapping!
Quick and easy !!!!
Regards!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Within PI there is no support for so-called Processing instructions in XML.
You have to add them with help of a Java/ABAP mapping or XSLT mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mick,
XML has no format..
You could create a html with tag <b> for bold.
Regards,
Udo
Edited by: Udo Martens on Feb 5, 2009 2:35 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.