Solved

java xml schema validation

Posted on 2010-11-18
7
1,276 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
  • 3
7 Comments
 
LVL 92

Accepted Solution

by:
objects earned 250 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 250 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now