You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Stefan Lecho <St...@iconmedialab.com> on 2001/04/04 08:40:51 UTC

DTD and Schema Def in same XML document

Hi,

I want to use a DTD reference as well as a schema reference in
the same XML document. Example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE personnel SYSTEM 'personal.dtd'>
<personnel xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
	   xsi:noNamespaceSchemaLocation='personal.xsd'>

Trying this multiple definition with the distributed
data/personal-schema.xml example, xerces generates 
the stack trace shown underneath.

Is it at all possible to include a DTD and a schema in the same document ?
And if the answer is 'yes', what is causing the error to be generated ?

Stack trace:
java.lang.ClassCastException: org.apache.xerces.validators.dtd.DTDGrammar
	at
org.apache.xerces.validators.common.XMLValidator.resolveSchemaGrammar(XMLVal
idator.java:2409)
	at
org.apache.xerces.validators.common.XMLValidator.bindNamespacesToElementAndA
ttributes(XMLValidator.java:2325)
	at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidat
or.java:921)
	at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanne
r.java:1858)
	at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScanner.java:1001)
	at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:381)
	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:991)
	at dom.wrappers.DOMParser.parse(DOMParser.java:111)
	at dom.DOMCount.count(DOMCount.java:138)
	at dom.DOMCount.main(DOMCount.java:334)

Thanks, Stefan Lecho.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org