cancel
Showing results for 
Search instead for 
Did you mean: 

SAX and DOM

Former Member
0 Kudos

Hi Everybody,

I have seen people telling that SAX and DOM are necessary for XI. Whay do we need it in XI?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Sonia,

Adding to above discussion,here i mentioned below how you would use java mapping, so you can be more familiar with the whole concept of java mapping.

Java Mapping is one of the mapping techinuqe which xi supports,

There are few steps which you need to follow while doing java mapping.

Steps:

1)you need to use any parsing Technique either DOM Or SAX.

2)Develop your java class with out main method in Netweaver Developer stdio.

3)Need to create a jar file in the Cmd(commond line promot.

Commond for creation of jar cf name.jar filename.class

4)import your jar file in to IR.you can see Imported Objects under software component.Right click on the Imported Object and select New and enter the name and browse your jar file and select the corresponding jar file which you created and click save and activate.

5)when you are doing Interface Mapping you need to select as Java calass and select the Mapping program and after the process is same as normal.

If you have any doubts please let me know I can very welcome to receive your queries.

Thanks and Regards,

Sekhar

bhavesh_kantilal
Active Contributor
0 Kudos

Sonia,

Just adding to the discussion here, Message Mapping / Graphical Mapping internally ses SAX parser to parse the XML.

SAX parser is a memoryless parser and is recommened when the XML strucutre is huge. DOM parser loads the entire XML into the memory and so when the XML size is to big, DOM parser is to be avoided.

Regards

Bhavesh

former_member91687
Active Contributor
0 Kudos

Hi,

When you do the mapping using Java mapping, you would require to parse the source XML, this is where SAX and DOM parsers would be used.

You have the execute method when you go for Java mapping, where the source structure is taken as an input stream, and then this has to be parsed, and this is done using SAX or DOM.

Each has its own advantages and disadvantages, have a look at this:

http://developerlife.com/saxvsdom/default.htm

Some blogs on java mapping:

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii

Regards,

Chandra

Former Member
0 Kudos

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.

On how to create XML docs with SAX and DOM go thruugh these links:

http://www.cafeconleche.org/books/xmljava/chapters/ch09.html

http://www.cafeconleche.org/books/xmljava/chapters/ch06.html

this information was shared by Chandra in one thread.

Thanks,

Pooja

null

Former Member
0 Kudos

SAX and DOM are Parsers , tht are used to parse the xml document,,

when you use java mapping ...... u need to first parse the incoming message into xi by using any of these parsing techniques.....then u can alter the parsed xml schema...according to the required target structure ,,,

DOM parser is also used in Abap mapping

Regards,

Sushil Hadge