You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Niranjan Kundapur <ni...@air2web.com> on 2002/02/20 01:05:08 UTC

DTD Validation error for namespace when using XHTML Modules

Hello,

I am trying to validate (with DTD) the example in Section E.4.1 in
"Modularization of XHTML"
(http://www.w3.org/TR/xhtml-modularization/dtd_developing.html#sec_E.4.1.) I
am using Xalan 2.3.0, which works with Xerces-Java 2.0.0.

My code looks like:

//create DocumentBuilderFactory
	DocumentBuilderFactory m_dbf = DocumentBuilderFactory.newInstance();
// set various configuration options
	m_dbf.setValidating(true);
	m_dbf.setIgnoringComments(false);
	m_dbf.setIgnoringElementContentWhitespace(false);
	m_dbf.setCoalescing(false);
	m_dbf.setNamespaceAware(true);
// create a DocumentBuilder that satisfies the constraints
// specified by the DocumentBuilderFactory
	m_db = m_dbf.newDocumentBuilder();
// parse
	doc = m_db.parse(theInputSource);

The error I get is as follows:

Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
set, which is probably not what is desired.  Parser will use a default
ErrorHandler to print the first 10 errors.  Please call
the 'setErrorHandler' method to fix this.
Error: URI=null Line=3: Attribute "xmlns:simpleml" must be declared for
element type "html".


I am not sure what I am doing wrong. Do I need to set any more properties on
the parser? Should I post this on Xerces list, maybe? 
Thanks in advance for any help.

- Niranjan