on 09-27-2007 10:14 PM
Hi all,
What is xslt mapping? In which cases we are using xslt mapping?
What is difference between java and xslt mapping?
Thanks all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
From a programmer's point of view, XSLT is a programming language for processing XML datathat 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:-
 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.
 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
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.