You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Worapatkitkul, Pairat" <pw...@inovant.com> on 2004/03/02 21:02:01 UTC

DOM3 methods not found

HI,
 I'm trying to compile sample dom DOM3.java coming  with beta2-xerces-2.6.2 package for windows because I want to use feature of validating xml doc with xml schema.

I use J2SE1.4.2_03 to compile DOM3.java and I got 2 errors about methods that can not be resolved.
I have my classpath pointed to dom3-xml-apis.jar  dom3-xercesImpl.jar xercesSamples.jar and I'm sure that it's correct setup.

When I compiled it. I got error about cannot resolve symbol as following:

C:\xerces-2_6_2\samples\dom>C:\j2sdk1.4.2_03\bin\javac DOM3.java
DOM3.java:144: cannot resolve symbol
symbol  : method getDomConfig ()
location: interface org.w3c.dom.Document
            config = doc.getDomConfig();
                        ^
DOM3.java:158: cannot resolve symbol
symbol  : method normalizeDocument ()
location: interface org.w3c.dom.Document
            doc.normalizeDocument();
               ^
2 errors

I tried to compile xerces 2.6.2 src package with target jars-dom3 to get same dom3 jar files to cross check. The testing result was the same. 
I check Document.java in src package and it includes these methods already and it's available  in jar file . Why it 's still can not be resolved?

I never thought that It's  depend on JDK version until I tried JDK1.5.0 beta1.
When I tried to compile it with J2SE1.5.0 beta 1 . The result is different. These methods can be resolved but I got another 2 errors about method can not be resolved as following:

C:\xerces-2_6_2\samples\dom>javac DOM3.java
DOM3.java:113: cannot find symbol
symbol  : method getDomConfig()
location: interface org.w3c.dom.ls.LSParser
            DOMConfiguration config = builder.getDomConfig();
                                             ^
DOM3.java:165: cannot find symbol
symbol  : method getDomConfig()
location: interface org.w3c.dom.ls.LSSerializer
            config = domWriter.getDomConfig();
                              ^
2 errors

So I look like JDK version affect to compiling result.
In JDK 1.5.0 beta1 , it includes new DOM3 methods but I dont' understand why I have method built in jar files and compile it with JDK1.4.2_03 the 2 methods still can not be resolved.?
Can anybody explain why this happen and how should I fix these problem?

Thanks very much.

Pairat 

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: DOM3 methods not found

Posted by Michael Glavassevich <mr...@apache.org>.
I believe the problem is that the XML APIs which are picked up at
compile time are the ones included with JDK 1.4.2 which contain DOM Level
2, instead of the DOM Level 3 API in dom3-xml-apis.jar. Getting your
application to compile against these APIs isn't as simple as putting them
in your classpath, since the system libraries on the JVM's bootclasspath
take precedence over your classpath. See this FAQ [1] from the Xalan docs
which describes how to run it on JDK 1.4. This applies equally to running
Xerces and building against new versions of endorsed standards with JDK
1.4.

[1] http://xml.apache.org/xalan-j/faq.html#faq-N100CC

On Tue, 2 Mar 2004, Mark Brucks wrote:

> Pairat:
>
> At least in the 2.6.0 version, those two methods are defined in the
> Xerces2 implementation of the DOM3 stuff (not in org.w3c.dom).  Look at
> the documentation for
>
> org.apache.xerces.dom.CoreDocumentImpl
>
> Assuming you have a validating parser, the Document instance that is
> returned to you by that parser will actually be an instance of
> CoreDocumentImpl.  So, for your first problem, something like the
> following should work
>
> config = ((org.apache.xerces.dom.CoreDocumentImpl) doc).getDomConfig();
>
> Much the same for normalizeDocument method.
>
> Good luck - Mark
>
> Worapatkitkul, Pairat wrote:
>
> >HI,
> > I'm trying to compile sample dom DOM3.java coming  with beta2-xerces-2.6.2 package for windows because I want to use feature of validating xml doc with xml schema.
> >
> >I use J2SE1.4.2_03 to compile DOM3.java and I got 2 errors about methods that can not be resolved.
> >I have my classpath pointed to dom3-xml-apis.jar  dom3-xercesImpl.jar xercesSamples.jar and I'm sure that it's correct setup.
> >
> >When I compiled it. I got error about cannot resolve symbol as following:
> >
> >C:\xerces-2_6_2\samples\dom>C:\j2sdk1.4.2_03\bin\javac DOM3.java
> >DOM3.java:144: cannot resolve symbol
> >symbol  : method getDomConfig ()
> >location: interface org.w3c.dom.Document
> >            config = doc.getDomConfig();
> >                        ^
> >DOM3.java:158: cannot resolve symbol
> >symbol  : method normalizeDocument ()
> >location: interface org.w3c.dom.Document
> >            doc.normalizeDocument();
> >               ^
> >2 errors
> >
> >I tried to compile xerces 2.6.2 src package with target jars-dom3 to get same dom3 jar files to cross check. The testing result was the same.
> >I check Document.java in src package and it includes these methods already and it's available  in jar file . Why it 's still can not be resolved?
> >
> >I never thought that It's  depend on JDK version until I tried JDK1.5.0 beta1.
> >When I tried to compile it with J2SE1.5.0 beta 1 . The result is different. These methods can be resolved but I got another 2 errors about method can not be resolved as following:
> >
> >C:\xerces-2_6_2\samples\dom>javac DOM3.java
> >DOM3.java:113: cannot find symbol
> >symbol  : method getDomConfig()
> >location: interface org.w3c.dom.ls.LSParser
> >            DOMConfiguration config = builder.getDomConfig();
> >                                             ^
> >DOM3.java:165: cannot find symbol
> >symbol  : method getDomConfig()
> >location: interface org.w3c.dom.ls.LSSerializer
> >            config = domWriter.getDomConfig();
> >                              ^
> >2 errors
> >
> >So I look like JDK version affect to compiling result.
> >In JDK 1.5.0 beta1 , it includes new DOM3 methods but I dont' understand why I have method built in jar files and compile it with JDK1.4.2_03 the 2 methods still can not be resolved.?
> >Can anybody explain why this happen and how should I fix these problem?
> >
> >Thanks very much.
> >
> >Pairat
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> >For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org

---------------------------
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: DOM3 methods not found

Posted by Mark Brucks <br...@j3s.us>.
Pairat:

At least in the 2.6.0 version, those two methods are defined in the 
Xerces2 implementation of the DOM3 stuff (not in org.w3c.dom).  Look at 
the documentation for

org.apache.xerces.dom.CoreDocumentImpl

Assuming you have a validating parser, the Document instance that is 
returned to you by that parser will actually be an instance of 
CoreDocumentImpl.  So, for your first problem, something like the 
following should work

config = ((org.apache.xerces.dom.CoreDocumentImpl) doc).getDomConfig();

Much the same for normalizeDocument method.

Good luck - Mark

Worapatkitkul, Pairat wrote:

>HI,
> I'm trying to compile sample dom DOM3.java coming  with beta2-xerces-2.6.2 package for windows because I want to use feature of validating xml doc with xml schema.
>
>I use J2SE1.4.2_03 to compile DOM3.java and I got 2 errors about methods that can not be resolved.
>I have my classpath pointed to dom3-xml-apis.jar  dom3-xercesImpl.jar xercesSamples.jar and I'm sure that it's correct setup.
>
>When I compiled it. I got error about cannot resolve symbol as following:
>
>C:\xerces-2_6_2\samples\dom>C:\j2sdk1.4.2_03\bin\javac DOM3.java
>DOM3.java:144: cannot resolve symbol
>symbol  : method getDomConfig ()
>location: interface org.w3c.dom.Document
>            config = doc.getDomConfig();
>                        ^
>DOM3.java:158: cannot resolve symbol
>symbol  : method normalizeDocument ()
>location: interface org.w3c.dom.Document
>            doc.normalizeDocument();
>               ^
>2 errors
>
>I tried to compile xerces 2.6.2 src package with target jars-dom3 to get same dom3 jar files to cross check. The testing result was the same. 
>I check Document.java in src package and it includes these methods already and it's available  in jar file . Why it 's still can not be resolved?
>
>I never thought that It's  depend on JDK version until I tried JDK1.5.0 beta1.
>When I tried to compile it with J2SE1.5.0 beta 1 . The result is different. These methods can be resolved but I got another 2 errors about method can not be resolved as following:
>
>C:\xerces-2_6_2\samples\dom>javac DOM3.java
>DOM3.java:113: cannot find symbol
>symbol  : method getDomConfig()
>location: interface org.w3c.dom.ls.LSParser
>            DOMConfiguration config = builder.getDomConfig();
>                                             ^
>DOM3.java:165: cannot find symbol
>symbol  : method getDomConfig()
>location: interface org.w3c.dom.ls.LSSerializer
>            config = domWriter.getDomConfig();
>                              ^
>2 errors
>
>So I look like JDK version affect to compiling result.
>In JDK 1.5.0 beta1 , it includes new DOM3 methods but I dont' understand why I have method built in jar files and compile it with JDK1.4.2_03 the 2 methods still can not be resolved.?
>Can anybody explain why this happen and how should I fix these problem?
>
>Thanks very much.
>
>Pairat 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org