Thanks!
-----Original Message-----
From: Tinny Ng [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 12:47 PM
To: [EMAIL PROTECTED]
Subject: Re: Schema Validator broken?
The ElementDecl pool from the validator is a collection of all the elements appear in the grammar, and in the XML document.
Each element has a "CreateReason", if this element has a corresponding definition in the grammar, then the "CreateReason" == Declared.� If this element only appears in the DTD ATTLIST, but itself is not defined in the grammar, then the "CreateReason" == AttList.� If this element only appears in the XML document, but not defined in the grammar, then the "CreateReason" == JustFaultIn ... etc.
So you can check the createReason by calling getCreateReason() and bypass those no needed.� Or if you only want those element that are defined in the grammar, you can call isDeclared() directly.
Tinny
"Williamson, Siehnai" wrote:
�
Hi,
Why does SchemaElementDecl in SEnumVal example contain elements from the XML document even if it is not in the schema?� Shouldn't it only contain those elements or values that are listed in the schema?
I have a dummy xml document with a root element called "dummy" pointing to the document's schema.� Whenever I run SEnumVal, the last element retrieved from SchemaElementDecl is this "dummy" element.� Since I don't know if the user will use the word "dummy" as the root element for her dummy document, I can't therefore check for "dummy" and eliminate it in my application.� The only alternative is to figure out the last element validated and then assume that this is the root element from the xml document.
Is there a better way to do this in Xerces or is there going to be a fix to remove the root element from being listed in the validator?
�
�
�
