I apologize if this problem has been addressed before, but I have had
trouble finding the fix to this problem.
I am attempting to validate a sample XML document against a sample XML
Schema, but I get a "Not Found" exception.
I would appreciate any help. See sample below:
Thanks in advance,
Thaddeus Thacker
Senior Java Engineer
--------------------------
Buzztime Entertainment, Inc.
5966 La Place Court, Suite 100
Carlsbad, CA 92008
Tel: 760.476.1976
Fax: 760.438.3505
E: [EMAIL PROTECTED]
XML DOCUMENT GRAMMAR REFERENCE:
<MESSAGE command="221"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://myserver/xml/test_content.xsd">
....
</MESSAGE>
XML SCHEMA BEGINNING:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="shipOrder" type="order"/>
SET PARSER FEATURE:
parser.setFeature("http://apache.org/xml/features/validation/dynamic",true);
THE EXCEPTION:
[XMLErrorHandler] Parsing error:
[XMLErrorHandler] Cannot continue.
org.xml.sax.SAXParseException: File "<MESSAGE command="221"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://mydevserver/xml/test_content.xsd"><shi
pOrder><shipTo><name>Tove Svendson</name><street>Ragnhildvei
2</street><address>4000
Stavanger</address><country>Norway</country></shipTo><items><item><title>Emp
ire
Burlesque</title><quantity>1</quantity><price>10.90</price></item><item><tit
le>Hide your
heart</title><quantity>1</quantity><price>9.90</price></item></items></shipO
rder></MESSAGE>" not found.
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1073)
at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(Defa
ultEntityHandler.java:499)
at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:309)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:951)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:993)
WHERE EXCEPTION OCCURS:
CLASS: org.apache.xerces.framework.XMLParser
METHOD: reportError(Locator locator, String errorDomain,
int majorCode, int minorCode, Object args[],
int errorType)
EXCEPTION LOCATION:
else if
(errorDomain.equals(ImplementationMessages.XERCES_IMPLEMENTATION_DOMAIN))
{
spe = new
SAXParseException(fgImplementationMessages.createMessage(fLocale, majorCode,
minorCode, args), locator);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]