cancel
Showing results for 
Search instead for 
Did you mean: 

UDF: DOM parser

Former Member
0 Kudos

HI,

do i need a special import to use this code and is it enough to fill it in the UDF import line ?

I think it´s important to store this java class somewhere in the XI server ?

code:

DOMParser parser = new DOMParser();

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

For DOM parser I have following imports in my Java program:

import javax.xml.parsers.*;

import javax.xml.transform.*;

import javax.xml.transform.dom.DOMSource;

import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.*;

Hope that helps

Stefan

Message was edited by:

Stefan Grube

Former Member
0 Kudos

it´s still not working even with Stefan´s imports.

/X.../j2ee/cluster/server0/./temp/classpath_resolver/Mapbf2f25109f4511dca2cd000b5dabc425/

source/com/sap/xi/tf/_MM_RFC_LOOKUP_.java:129: cannot resolve symbol symbol :

class DOMParser location: class com.sap.xi.tf._MM_RFC_LOOKUP_

DOMParser parser = new DOMParser();

^

stefan_grube
Active Contributor
0 Kudos

In my code there is nothing like DOM parser.

I have something like this:

...
Document document;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
// create DOM structure from input XML
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(in);
...

But this is part of a Java mapping, so I am not sure how you can use this inside an UDF.

Regards

Stefan

Former Member
0 Kudos

Stefan,

can you prive me your java DOM function ?

Thanks and have a nice Weekend,

Gordon

Former Member
0 Kudos

Hi Borden

to learn about how to use java in XI for DOm parser You can use follow link. It

Provides the interfaces for the Document Object Model (DOM) which is a component API of the Java API for XML Processing.

http://java.sun.com/javase/6/docs/api/org/w3c/dom/package-summary.html

hope this may solve your problem

thanks

sandeep sharma

PS: if helpful please reward points

Former Member
0 Kudos

No. You dont need any spl imports. DOM is parser is a part of java.lang package.

You can use the piece of code by Stefan in the other post.

Regards,

Jai Shankar

Former Member
0 Kudos

yes, but i want a DOM version, too.

i have a syntax error saying:

cannot resolve symbol symbol : class DOMParser location: class com.sap.xi.tf._MM_RFC_LOOKUP_ DOM

Parser parser = new DOMParser();

prateek
Active Contributor
0 Kudos

Have u seen this?

/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

Regards,

Prateek