XMLSchema, validation

Discussion in 'Java' started by Marcin Wielgus, Mar 16, 2006.

  1. help please. The code below throws this:

    java.lang.UnsupportedOperationException: This parser
    does not support specification "null" version "null"

    in code:

    DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
    SchemaFactory factory =
    SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Source schemaFile = new StreamSource(new File("filename.xsd"));
    Schema schema = factory.newSchema(schemaFile);
    dbfactory.setSchema(schema); <--here the exception is thrown
    dbfactory.setNamespaceAware(true);
    DocumentBuilder parser = dbfactory.newDocumentBuilder();
    parser.setErrorHandler(new ConfigurationFileErrorHandler());
    doc = parser.parse(is);

    filename.xsd looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/
    XMLSchema"
    targetNamespace="http://ernie.icslab.agh.edu.pl/
    wielgus/chameleon/Operation"
    xmlns="http://ernie.icslab.agh.edu.pl/wielgus/
    chameleon/Operation">
    <xsd:element name="chameleonoperation"
    type="ChameleonOperation"/>
    <xsd:complexType name="ChameleonOperation"/>
    </xsd:schema>

    I would like to know why is this happening. Not really interested in how
    to fix this, but mainly why. This code used to work some time ago, and i
    don't know what has changed that it is no longer working.


    --

    SaSol
     
    Marcin Wielgus, Mar 16, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sudha
    Replies:
    0
    Views:
    370
    sudha
    Jun 30, 2003
  2. Mattias
    Replies:
    1
    Views:
    441
    Martin Honnen
    Dec 4, 2003
  3. BODIN
    Replies:
    0
    Views:
    626
    BODIN
    Dec 8, 2003
  4. Robert Ludewig

    XMLSchema and XML Validation problem

    Robert Ludewig, Jun 28, 2004, in forum: XML
    Replies:
    4
    Views:
    600
    Martin Honnen
    Jun 28, 2004
  5. Peter Fitzgibbons

    XML Validation against XMLSchema ?

    Peter Fitzgibbons, Oct 17, 2005, in forum: Ruby
    Replies:
    1
    Views:
    128
    Robert Klemme
    Oct 17, 2005
Loading...

Share This Page