Solved

java xml schema validation

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

790 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