Solved

java xml schema validation

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

738 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