I was able to validate my XML file with an XML Schema with an older version
of xerces. But once we ported to Weblogic 6.1 and were required to use the
xerces that was packaged with it which is version 1.3.1, I ran into the
following exception when trying to validate my XML.

 Warning:Element type "RequestAnalysis" must be declared.
Exception in thread "main" org.xml.sax.SAXParseException: Element
type "RequestAnalysis" must be declared.
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1067)
at
org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError
(XMLValidator.java:1645)
at
org.apache.xerces.validators.common.XMLValidator.validateElementAndAttribute
s(XMLValidator.java:3236)


The java file contains the following lines to set validation on:

DOMParser parser = new DOMParser();
parser.setFeature("http://xml.org/sax/features/validation",true);
parser.setFeature("http://xml.org/sax/features/namespaces";, true);
parser.setFeature("http://apache.org/xml/features/validation/schema",true);

The XML file is:
<?xml version="1.0" encoding="UTF-8"?>
   <RequestAnalysis xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
     xsi:noNamespaceSchemaLocation='metreoSchema.xsd'>
        <ScreenName>RequestAnalysis</ScreenName>

Any idea why the validation that used to work is failing now?

Anchal


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to