cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting process tag

Former Member
0 Kudos

Hi,

I have a mapping requirement where I need to insert an extra processing instruction beneath the xml tag as below.

input

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:Order xmlns:ns0="rrn:org.xcbl:schemas/xcbl/v3_0/xcbl30.xsd">

<ns0:OrderHeader>

<ns0:OrderNumber>

0000001

</ns0:OrderNumber>

</ns0:OrderHeader>

</ns0:Order>

I need the following output

<?xml version="1.0" encoding="UTF-8" ?>

<?soxtype urn:xxxx:schema1.sox$1.0?>

<ns0:Order xmlns:ns0="rrn:org.xcbl:schemas/xcbl/v3_0/xcbl30.xsd">

<ns0:OrderHeader>

<ns0:OrderNumber>

0000001

</ns0:OrderNumber>

</ns0:OrderHeader>

</ns0:Order>

I am mapping from ORDERS05 IDOC to Orders.xsd using xcbl xsd schema.Per SAP Note 898010 I need to put this sox statement for my adapter to process the document.

How can I insert the sox type processing instruction?I need this statement as a second line in the output as otherwise the Marketplace adapter is not recognizing the document. I have already did my mapping in XI using graphical tool and do I need to do a second XSLT mapping to achieve this?

I tried inserting this statement in the input prior to my mapping, but XI is removing this line in the output.

Please let me know different options I have and any guidance is greatly appreciated.

Thanks

Raju

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Raju,

It is quite simple, you may need to do an ADDITIONAL step to your current mapping. You can achieve this in going for Java mapping (additional map in the sequence, 'order of execution' can be as per your logic of the map) in your Interface mapping object.

have a java class, which writes this tag to your XML msg (other than your regular mapping)

check my replies in this link

Hope this fixes your issue.

Regards

Vishnu

Former Member
0 Kudos

Bhanu and Vishnu,

Thank you for your answers.I have not tried the java mapping, but tried the xslt using spy and mapforce.The tags I insert in the input are not retained in the output, in XI and mapforce as well. Bhanu, have you tried this? If you are able to do this, then I definitely miss something here.

Vishnu, can you forward some sample java code to copy this?My email address is rajujampaan@hotmail.com?

Thank you

Raju

Former Member
0 Kudos

Hi Raju,

Sent the code, Hope this fixes your issue.

Regards

Vishnu

Former Member
0 Kudos

Hi Raju,

I use the StylusStudio. This generates an XSLT file with '.xsl; extension. Even the Mapforce also should generate such file.

In the generated XSL File, you can manually enter the line of code for the SOX. The XSL file can be edited in the Studio or Mapforce and saved. If there is an issue, you can edit in Notepad as well and save.

Cheers,

Bhanu

Former Member
0 Kudos

Ooops....

Please excuse my fat fingers.the correct email id is

rajujampana@hotmail.com

Appreciate if you can resend it.

Thanks

Raju

Former Member
0 Kudos

Vishnu, Thank you,

I fixed the isssue using the xslt processing-instruction command, but your code is helpful too.

Points awarded.

Raju

Former Member
0 Kudos

Bhanu,

Your suggestion of using Stylus Studio worked for me.I realized that it's better than Altova...as far as my problem is concerned atleast.

Points awarded.

thanks

Raju

Former Member
0 Kudos

Hi,

The XI Graphical mapping is at the element level. Your requirement needs modification at the message level. So, I think you will need XSLT or Java mapping.

XSLT mapping actually is really simple to implement, especially if you have mainly 1 to 1 element mapping ('value-of select' XSLT tags). The steps will be:

1) You can write up XSLT in a text editor for simple mappings, if you are familiar with XSLT. If not, use the ALTOVA or STYLUSSTUDIO or some other XSLT editors. If you want, download the trial versions. Those are useful and have a XSLT help as part of the package help.

www.Altova.com/XMLSpy

www.stylusstudio.com

2) Assign a source and target XSD in the XSLT editor and create the mappings. This will generate a XSLT file. In this, add your SOX statement.

3) In the XI Integration Repository, in the SWCV, use the 'import archive' step to import the XSLT file.

4) Assign this in the Interface mapping.

Cheers,

Bhanu