You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by David Lindquist <dl...@softroots.com> on 2001/09/07 00:01:57 UTC

newbie question: schema validation in Xerces-J 1.4.1

Hello,

I receive the following error message when I try to validate an XML document
against a schema:

	"The markup declarations contained or pointed to by the document type
declaration must be well-formed."

I am using SAX 2.0 and Xerces-J 1.4.1. I have verified that the schema is
well-formed. The parsing worked fine when I referenced a DTD. Why can I not
simply change the document type declaration to reference the schema file? Or
does Xerces-J 1.4.1 not support schemas in this way?

Dave Lindquist
SoftRoots, Inc.


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


RE: newbie question: schema validation in Xerces-J 1.4.1

Posted by David Lindquist <dl...@softroots.com>.
Thank you for your help.

I removed the document type declaration and referenced the schema in the
root node as you suggested. I now receive a new error:

	 Element type "Method" must be declared.

"Method" is my root element.

I'm sure I am making some kind of rookie mistake. Instead of asking everyone
to help me debug my project, perhaps someone can suggest some reference
material on schema validation using SAX and Xerces 1.x?

-----Original Message-----
From: Andreas Thönnessen [mailto:at@philosys.de]
Sent: Friday, September 07, 2001 1:32 AM
To: xerces-j-user@xml.apache.org
Subject: Re: newbie question: schema validation in Xerces-J 1.4.1


David Lindquist schrieb:
:
> I am using SAX 2.0 and Xerces-J 1.4.1. I have verified that the schema is
> well-formed. The parsing worked fine when I referenced a DTD. Why can I
not
> simply change the document type declaration to reference the schema file?
Or
> does Xerces-J 1.4.1 not support schemas in this way?
:
In difference to the DTD reference

<!DOCTYPE rootnode SYSTEM "my.dtd">

the reference to a schema must be made with

<rootnode
	xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
	xsi:noNamespaceSchemaLocation='my.xsd'>
:
</rootnode>

It's not possible to only change the "my.dtd" to "my.xsd"!

Hope this helps,

Andi.
--
----------------------------------------------------  _____
 Andreas Thönnessen           mailto:at@philosys.de    /|
 Philosys Software GmbH     http://www.philosys.de/   /_|
---------------------------------------------------- /  |


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


Re: newbie question: schema validation in Xerces-J 1.4.1

Posted by Andreas Thönnessen <at...@philosys.de>.
David Lindquist schrieb:
: 
> I am using SAX 2.0 and Xerces-J 1.4.1. I have verified that the schema is
> well-formed. The parsing worked fine when I referenced a DTD. Why can I not
> simply change the document type declaration to reference the schema file? Or
> does Xerces-J 1.4.1 not support schemas in this way?
:
In difference to the DTD reference

<!DOCTYPE rootnode SYSTEM "my.dtd">

the reference to a schema must be made with 

<rootnode
	xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
	xsi:noNamespaceSchemaLocation='my.xsd'>
:
</rootnode>

It's not possible to only change the "my.dtd" to "my.xsd"!

Hope this helps,

Andi.
-- 
----------------------------------------------------  _____
 Andreas Thönnessen           mailto:at@philosys.de    /|
 Philosys Software GmbH     http://www.philosys.de/   /_|
---------------------------------------------------- /  |