Changeset 4770 in josm


Ignore:
Timestamp:
2012-01-08T15:46:23+01:00 (13 years ago)
Author:
bastiK
Message:

change validation method. this should work around the java bug (see #7206)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r4656 r4770  
    3737import javax.swing.JOptionPane;
    3838import javax.swing.UIManager;
    39 import javax.xml.parsers.SAXParserFactory;
     39import javax.xml.XMLConstants;
    4040import javax.xml.stream.XMLInputFactory;
    4141import javax.xml.stream.XMLStreamConstants;
    4242import javax.xml.stream.XMLStreamException;
    4343import javax.xml.stream.XMLStreamReader;
    44 import javax.xml.transform.stax.StAXSource;
    4544import javax.xml.transform.stream.StreamSource;
    4645import javax.xml.validation.Schema;
     
    14301429
    14311430    public void validateXML(Reader in) throws Exception {
    1432         SchemaFactory factory =  SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
     1431        SchemaFactory factory =  SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    14331432        Schema schema = factory.newSchema(new StreamSource(new MirroredInputStream("resource://data/preferences.xsd")));
    1434         XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(in);
    14351433        Validator validator = schema.newValidator();
    1436         validator.validate(new StAXSource(parser));
     1434        validator.validate(new StreamSource(in));
    14371435    }
    14381436
Note: See TracChangeset for help on using the changeset viewer.