Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3548

Re: Problems faced in xslt mapping

$
0
0

Treya,

 

<XYZ xsi:type="ase:ABCDEF">

 

This is not well-formed XML. Element/Attribute names can not have :. GraphicalMapping/XSLT can not create not well-formed XML.

You can create graphical mapping for <XYZ xsi__type="ase:ABCDEF">

Then use Java Mapping (after graphical map) to replace xsi__type withxsi:type

 

package javaapplication1;
import java.io.*;
import com.sap.aii.mapping.api.*;
public class NewClass1 {    public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {        try {            InputStream inputstream = transformationInput.getInputPayload().getInputStream();            OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();            // Copy Input content to Output content              byte[] b = new byte[inputstream.available()];            inputstream.read(b);            String input = new String(b);            input = input.replaceAll("xsi__type", "xsi:type");            outputstream.write(input.getBytes());        } catch (Exception exception) {            throw new StreamTransformationException(exception.toString());        }    }
}

Viewing all articles
Browse latest Browse all 3548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>