Solved

java xml schema validation

Posted on 2010-11-18
7
1,297 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Fixing Non-Standard characters in text 8 91
stackato and cloud 4 69
javap not working 8 36
JQuery to parse xml string and get element by id 4 22
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

911 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

27 Experts available now in Live!

Get 1:1 Help Now