Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8714357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:34:45+00:00 2026-06-13T05:34:45+00:00

I am trying to validate XML files using standard Java libraries and get the

  • 0

I am trying to validate XML files using standard Java libraries and get the above error. My XSD file test1.xsd is

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:complexType name="foo">
        <xsd:attribute name="bar" type="xsd:string" />
    </xsd:complexType>  
</xsd:schema>

with code (running as Junit test in Eclipse):

@Test
public void testValidatingParser1() throws Exception {
    String SCHEMA_PATH = "test1.xsd";
    InputStream SCHEMA_STREAM = getClass().getResourceAsStream(SCHEMA_PATH);
    StreamSource SCHEMA_SOURCE = new StreamSource(SCHEMA_STREAM);
    SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = sf.newSchema(SCHEMA_SOURCE);
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setSchema(schema);
}

The error is:

java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.DocumentBuilderFactory.setSchema(Unknown Source)
at org.xmlcml.graphics.misc.SchemaTest.testValidatingParser1(SchemaTest.java:123)

This error seems to arise from incompatibilities with XML parsers (such as Xerces) see this post but I have no frameworks (other than Eclipse and Junit). I do not have xerces explicitly in my POM. Is there a simple workround (I don’t mind what parser I use as long as it validates).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:34:46+00:00Added an answer on June 13, 2026 at 5:34 am

    I tracked it down to incompatible versions of Xerces, included from other software. Forcing the later versions of Xerces cures the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to validate my XML files from given XSD file with the following
I'm trying to validate an XML file with XSD, but I get a Could
I'm trying to validate an XML file against an XSD using the function schemaValidate(String
I'm trying to validate an XML file, but I get the following error: Can
I'm trying to validate a simple XML file against an XML schema using the
I am trying to validate my xml against it's xsd and getting the error
I'm trying to use the XML::LibXML::Schema to validate a xml file against a xsd.
I'm trying to validate an XML file against the schemas it references. (Using Delphi
I am trying to validate xml files against a very large industrial schema using
I have been trying to validate XML file using schema file in my C

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.