Hi.

> on a related note , i wanted to discuss how do we plan to use
> ValidateContext in SchemaValidator. I wanted to know ur views
> before i could go ahead with it :)

For certain datatypes (ID, IDREF, ENTITY, QNAME, etc.), extra information
is needed for validation. For example, we need to check duplicate ID
values, so we'll pass a list of ID values that we have already seen to the
IDDV, and IDDV will check whether the current value is already in that
list, if so, it's an error, if not, IDDV will add the new value into that
list.
For IDREF, a list is also provided to hold all seen IDREF values, which
will be checked against the above mentioned ID value list to see whether
there is a IDREF value without a match ID value.
For ENTITY, we need to check whether an entity is declared. In Xerces1, we
used to have an EntityHandler, which contains all the information of
declared entities. It's not decided yet how to check entity in Xerces2.
For QName, we'll need a NamespaceSupport, which holds the namespace binding
information. We need it to resolve a prefix to a namespace uri.

There are ways to provide all these information to the DVs:
1. Have an Object parameter on validate() method, and convert the above
mentioned objects to Object;
2. As in Xerces1, introduce a State interface, and store the above objects
in such interface as data;
3. Have a ValidateContext class to hold all such possible information.

I lean toward the last one, so that we don't need to do any casting. But
it's not final yet. Any better idea is welcome.

Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to