Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

java xml schema validation

Posted on 2010-11-18
7
Medium Priority
?
1,428 Views
Last Modified: 2012-05-10
Hello Expert:
                   I want to ask you a question. how I can  use

javax.xml.validation.SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1") to validation a xml file with corresponding xml Schema file

Because I get the error information:

java.lang.NoSuchFieldError: W3C_XML_SCHEMA11_NS_URI
org.apache.xerces.jaxp.validation.XMLSchema11Factory.<init>(Unknown Source)
0
Comment
Question by:studysolution0920
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 
LVL 92

Accepted Solution

by:
objects earned 750 total points
ID: 34169559
you don't specify the schema there, you configure it with you builder factory

http://helpdesk.objects.com.au/java/specifying-schema-for-xml-validation
0
 

Author Comment

by:studysolution0920
ID: 34173636
Hello Expert:
                  I have tried to use the method you have give to solve the problem. But the errors are still thrown away again.  I have uploaded the method validation. Can you check it? Thanks! method for validating xml file method for validating xml file
0
 
LVL 20

Assisted Solution

by:Venabili
Venabili earned 750 total points
ID: 34175392
Check what versions of Xerces you are using for compilation and for running the program.

The error is basically telling you that the version you are running the program with does not have a certain variable. That's something that a compiler is catching usually but if you compile with one version and then use it with another, the compilation works as expected.. and then all fails when you need to use the code.
0
 

Author Comment

by:studysolution0920
ID: 34186724
Hello Expert:
                  I use xercesImpl-2_10_0 and xercesImpl-2.10.0-xml-schema-1.1-beta. Is it correct?
0
 

Author Closing Comment

by:studysolution0920
ID: 34253181
thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question