cancel
Showing results for 
Search instead for 
Did you mean: 

Use of XSLT mapping

Former Member
0 Kudos

Hi Experts

Can you send me the Use of XSLT mapping ,and plz send me some simple Example.

Thanks

Rupash

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Rupesh,

Graphical mapping is the default mapping provided in XI,

but in many situations graphical mapping fall short to provide the required functionality.

In this case we go for Java/XSLT mapping.

The below link contains a very good example of XSLT mapping.

[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a]

Reward Points iof helpful

--Sankar Choudhury

Former Member
0 Kudos

Hi Rupash,

XSLT stands for:Extensible Stylesheet Language Transformations

It is an XML based language for transforming XML documents into any other formats, on the basis of well defined rules.

The advantages of using XSLT mapping over others are: The XSL program itself defines its own target structure.

An XSLT program can be imported directly into SAP-XI, avoiding the message mapping steps.

Many XPath functions are available which can easily replace graphical mapping with UDFs written in Java.

File content conversion can be avoided at receiver end, if the output format is text or HTML.

XSLT can be used in combination with Graphical mapping.

It can be used to transform:

XML – XML

XML – Text

XML – HTML/DHTML

XML – PDF

regards,

arijit

ps:please reward point if helpful.

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.

It can be used to transform

• XML to XML - From one XML data format to another

• XML to Text

• XML to HTML/XHTML

• XML to PDF

Writing an XSL program to transform XML document into desired format is not a difficult task though it seems to be in the beginning. It requires basic knowledge of XML tags, basic XPath concepts and HTML.

We will concentrate more on use of XSLT in XI (EXchange Infrastructure) for mapping.

Before starting with XSLT let’s get familiar with the following terms:-

• XML

• HTML

• XPath

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:-

 When the required output is other than XML like Text, Html or XHTML (html displayed as XML )

 When default namespace coming from graphical mapping is not required or is to be changed as per requirements.

 When data is to be filtered based on certain fields (considering File as source)

 When data is to be sorted based on certain field (considering File as source)

 When data is to be grouped based on certain field (considering File as source)

4.2 Advantages of using XSLT mapping

 XSLT program itself defines its own target structure.

 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.

 XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.

 File content conversion at receiver side can be avoided in case of text or html output.

 Multiple occurrences of node within tree (source XML) can be handled easily.

&#61692; Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).

&#61692; Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.

&#61692; XSLT mapping requires more memory than mapping classes generated in Java.

&#61692; XSLT program become lengthier as source structure fields grows in numbers.

&#61692; XSLT program sometimes become complex to meet desired functionality.

&#61692; Some XSL functions are dependent on version of browser.

Former Member
0 Kudos

Simple example

/people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping

Mudit

Former Member
0 Kudos

Hi,

XSLT mapping is just a mapping similar to Message mapping available in the SAP XI, the xml mapped

file is said to be XSLT mapping, A tool available from Stylus studio

XSLT Mapping

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:-

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

When default namespace coming from graphical mapping is not required or is to be changed as per

requirements.

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

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

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

Advantages of using XSLT mapping

    1. XSLT program itself defines its own target structure.

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.

XSLT provides use of number of standard XPath functions that can replaces graphical mapping

involving user defined java functions easily.

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

Multiple occurrences of node within tree (source XML) can be handled easily.

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.

http://help.sap.com/saphelp_nw2004s/helpdata/en/8a/7672f7d7e444439fd7024f806221a4/content.htm

Error Handling In XSLT

see the below links

XSLT Mapping

/people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping

/people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt

/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

Regards

Seshagiri

Edited by: N V Seshagiri on Mar 19, 2008 10:37 AM