on 03-30-2006 1:35 AM
Hi,
I came to know that there are two kind of parsers used for java mapping:
DOM and SAX.
Now, I am just wondering what is this parser and how does it come into picture.
Lets say I have soyrce message types
first name and last name
Now I want to concatenate this two for target mesage (I know we can use standard function to map this but I am taking this simple example for understanding purpose) then I can just write small java function in java editor in mapping screen.
<b>Where does DOM and SAX parser come in picture ?</b>
Hi Tushar,
SAX and DOM are different APIs,SAX models the parser, DOM models the XML document. SAX programs can be much faster than their DOM equivalents, and almost always use far less memory.SAX works extremely well when documents are streamed, and the individual parts of each document can be processed in isolation from other parts.
You use SAX when, you have huge docs, when the entire doc is not availabe and processing can be done in chunks of input, processin can be divided into into a chain of successive operations.
DOM is used when, the program needs to access widely separated parts of the document at the same time or has to access multiple documents at the same time, The internal data structures complicated,or it might be required that the program must modify the document repeatedly or the program must store the document for a significant amount of time through many method calls.
<b>On how to create XML docs with SAX and DOM go thruugh these links:</b>
http://www.cafeconleche.org/books/xmljava/chapters/ch09.html
http://www.cafeconleche.org/books/xmljava/chapters/ch06.html
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi tushar,
The user defined functions that you write in your Graphical Mapping has nothing to do with Java Mapping.
In your Graphical Mapping, the parsing of source structure is handled interannly by XI.
But, when you go for an explicit mapping technique like Java Mapping, you have to parse the source XML structure, so that you can write the logic for your mapping.
Java Mapping will execute a method called Execute, that will take the source XML structure as the Input Stream and then, you have to parse the Input STream and to do this parsing, you use SAX or DOM parser.
DOM processor loads the entire XML into the memory and is processor intenseive, SAX does it element by element and so is not processor intensive.
Hope this info helps,
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi tushar,
for further info, just check these links,
If you are using SAX parser, there are 5 methods . They are 1) Start of the document(startDocument)
2) start of the element(startElement)
3) end of the element(endElement)
4) end of the document(endDocument)
5) chars()
Also check with any java site about SAX events how it works etc.
<b>Java Mapping
</b>
http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
<b>DOM parser API
</b>
http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
Regards,
Bhavesh
Hi,
You can do Java Mapping in the NetWeaver Developer Studio(NDS).
But you need to import some of the Jar files etc. Once you done the Mapping , you need to export it and import into Repository->Imoprted Archives .
<i>****Do I need to use external netbeeans kind of editor and import the code in XI ?</i>
You need to have just Jar files to import into XI.
Here it goes-
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
Hope this helps.
Regards,
Moorthy
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.