You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Suk Tae Kyung <tk...@penta.co.kr> on 2000/10/13 11:31:31 UTC

The problem of DOM 2

Hi Xerces Developers. I found serious problem of DOM Level 2. I want to know your

opinion. DOM Level 1 and Level 2 have the same package name.(org.w3c.dom)

But their content have changed. Level 2 have more interface or more method in

each interface. 

Now i'm developing xml program using Xerces 1.3 which support DOM Level 2

and JRun 3.0 whice uses internally sun parser which support DOM Level 1.

I wrote some code using Level 2 method. Here is the snippet.

    ...
    Document doc = new DocumentImpl();
    Node node = doc.importNode(someNode, true);
    try {
         node.appendChild(someNode);
    }
    catch(Exception e) {
        ...
    }
    ...

Document.importNode() method is from DOM Level 2. To compile and run this program,

I should use parser supporting DOM  Level 2 (for example, Xerces). But JRun forces to

use sun parser before Xerces. Because JRun searches class from internal classpath 

to user-defined classpath, i can't change the order. The result is "can't find importNode()

method at Document class" error.

I think this is the problem of not only JRun but also many other server which uses internally

DOM level 1 parser. Whenever i use such server, i forgive to use DOM Level 2.

I think fundamental problem is same package name between level 1 and level 2.

What do you think about it? Is there any way to escape this problem?

Re: The problem of DOM 2

Posted by Antonio Menchero Fernández <am...@aqs.es>.
At 18.31 13/10/00 +0900, you wrote:
>
>Now i'm developing xml program using Xerces 1.3 which support DOM Level 2
>
>and JRun 3.0 whice uses internally sun parser which support DOM Level 1.
>



>Document.importNode() method is from DOM Level 2. To compile and run this 
>program,
>
>I should use parser supporting DOM  Level 2 (for example, Xerces). But 
>JRun forces to
>
>use sun parser before Xerces. Because JRun searches class from internal 
>classpath
>
>to user-defined classpath, i can't change the order. The result is "can't 
>find importNode()
>
>method at Document class" error.
>
>I think this is the problem of not only JRun but also many other server 
>which uses internally
>
>DOM level 1 parser. Whenever i use such server, i forgive to use DOM Level 2.
>
>I think fundamental problem is same package name between level 1 and level 2.
>
>What do you think about it? Is there any way to escape this problem?


When using JRun, you can simply put "user.classpath" as the first path in 
"java.classpath" in
the file JRun/lib/global.properties, as follows:

java.classpath={user.classpath};{jrun.classpath};{ejb.classpath};{servlet.classpath}

then you should include xerces.jar in your servers/lib or 
servers/myserver/lib and everything works as expected.