cancel
Showing results for 
Search instead for 
Did you mean: 

mappings

Former Member
0 Kudos

Hi all,

What is xslt mapping? In which cases we are using xslt mapping?

What is difference between java and xslt mapping?

Thanks all.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Please refer my answers

Also

Thanks

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks all.

Former Member
0 Kudos

Hi

From a programmer's point of view, XSLT is a programming language for processing XML data—that is, transforming XML documents. As such, it supports the following:

A small set of flexible data types: Boolean, number, string, node-set, and external objects.

A full set of operations: <xsl:template>, <xsl:apply-templates>, <xsl:sort>, <xsl:output>, and so on.

Programming flow-control: <xsl:if>, <xsl:for-each>, <xsl:choose>, and so on.

Basic difference between features of Java and XSLTmapping are as follows

XSLT:-

-Open Standard

- Portable

-Extensible via Java user defined functions

-Memory over head for documents

-XSLT mappings can be imported into the integration repository

JAVA:-

-flexibility of java programming language

-Java mapping program is responsible for parsing/rendering XML

-java methods can be called from within the XSLT style sheet.

Former Member
0 Kudos

XSLT stands for EXtensible Stylesheet Language Transformations. It is an XML based language for transforming XML documents into any other formats suitable for browser to display, on the basis of set of well-defined rules.

Graphical mapping is a common approach followed by everyone for generating desired target structure. It involves simple drag-n-drop to correlate respective nodes (fields) from source and target structure. It hardly involves coding. (Exception – User defined functions). But sometimes with graphical mapping it is difficult to produce required output. For example … text/html output, namespace change, sorting or grouping of records etc. A person comfortable with Object Oriented ABAP can go for ABAP mapping instead. One can also think of Java mapping as another option but it is a bit complex and required knowledge of Java. In such cases, XSLT mapping can be the best approach to meet the requirements.

A few example cases in which an XSLT mapping can be used:-

&#61692; When the required output is other than XML like Text, Html or XHTML (html displayed as XML )

&#61692; When default namespace coming from graphical mapping is not required or is to be changed as per requirements.

&#61692; When data is to be filtered based on certain fields (considering File as source)

&#61692; When data is to be sorted based on certain field (considering File as source)

&#61692; When data is to be grouped based on certain field (considering File as source)

4.2 Advantages of using XSLT mapping

&#61692; XSLT program itself defines its own target structure.

&#61692; XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.

&#61692; XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.

&#61692; File content conversion at receiver side can be avoided in case of text or html output.

&#61692; Multiple occurrences of node within tree (source XML) can be handled easily.

&#61692; XSLT can be used in combination with graphical mapping.

&#61692; Multi-mapping is also possible using xslt.

&#61692; XSLT can be used with ABAP and JAVA Extensions.

Former Member
0 Kudos

XSLT as well as Java both is used in XI to transform the source message to target message.

XSLT is the extensible markup language use to transform one XML document to another XML document...now you might be thinking why we need to transfom it...look this example..

<b>

Input</b>

Input XML is:

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

<ns0:MT_Customer xmlns:ns0="http://farooq.com/XI/Demo/FileToJMS">

<Customer>

<Fame>Farooq</Fame>

<Mname>Mazhar</Mname>

<Lname>Farooqui</Lname>

<CustomerID>123123</CustomerID>

<Address>

<Street>Street</Street>

<City>Pune</City>

<PIN>2321</PIN>

<Country>India</Country>

</Address>

</Customer>

</ns0:MT_Customer>

<b>now but u want XML that look like this</b>

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

<ns0:MT_Customer xmlns:ns0="http://farooq.com/XI/Demo/FileToJMS">

<Customer>

<Name>Farooq Mazhar Farooqui</Name>

<CustomerID>123123</CustomerID>

<Address>

<Street>Street</Street>

<City>Pune</City>

<PIN>2321</PIN>

<Country>India</Country>

</Address>

</Customer>

</ns0:MT_Customer>

In the target XML the fname, mname and the lname are concatinated...but how we can do this??? applying some logic...so here the XSLT or Java Mapping comes in picture(this is just a simple scenario, u can easily achieve it using Graphical Mapping tool)

>>>Diff between XSLT and Java Mapping.

XSLT is use when you have complex transformation..but in XSLT we use Xpath so if there is a source file with huge valume then it is very slow...

Then we for Java Mapping, as we know java is so strong then XSLT because it provide API's and we can use that...for reading XML documents Java provides SAX and DOM API's.

Bottom line XSLT is use when voulume of message is less and complexcity is manageable using XSLT funcation...

If Volume of message is large as well as transformation is also complex then go for Java Mapping...that depends on requirement.

Thanks

Farooq.

<b>*Rewards points if you find it useful*</b>

agasthuri_doss
Active Contributor
0 Kudos

Hi,

XSLT is a tool,

This will help you

XSLT can be used in combination with graphical mapping.

Multi-mapping is also possible using xslt.XSLT can be used with ABAP and JAVA Extensions.

Regards

Agasthuri Doss