Document document = null; DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); document = parser.paser(xmlFilePath);
ParseException SaxException IOException
returned document without exception.
Using xmllist "schema" xml validated
SchemaFactory schema = SchemaFactory.newInstance(XMLConstanst.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(new Source []{new StreamSource(xsd1), new StreamSource(xsd2), new StreamSource(xsd3), newStreamSource(xsd4)})
Validator validator = schema.newValidator(); validator.setErrorHandler(new CustomHandler);
validator.validate(new DOMSource(document);
SAXParseException cvc-elt.1 Cannot find the declaration of element "ElementinQuestion"
String node = document.getNodeName();
node = #document
When the following is added the node returns the same exception above
String node = document.getFirstChildNode().getNodeName();
node = "ElementinQuestion"
xsd
<s: element name = "ElementinQuestion" type = elementinquestion:ElementinQuestion"
What else can I check?