Hi,

Dear all,
I want to validate XML document whenever changes are done and to provide
some
information about schema to guide editing process (real time validation).


This feature is also called write validation, the idea is that you revalidate the XML document that you are building on the fly programmatically. Such capability is not available in the current version of the parser ( Xerces 1.3.0 . It is among the number of features to be implemented.



 I read in the archives that Xerces can tell a lot about schema by using
GrammarResolver.I can't even understand what GrammarResolver does . I tried


I don't know how you could have gotten such idea, GrammarResolver is just a mechanism for abstracting a set of Grammars. These Grammars could be a DTD, a group of Schemas representing an XML Document or any other group of classes describing the structure of an XML document.


It is really the Grammar class which you want to look at, because a Grammar represents an internal (Xerces-j internal) way of representing an XML Structure. There are 2 type of Grammars: SchemaGrammar and DTDGrammar.

Depending into what implementation you are looking at: Xerces 1 or Xerces 2 they both represent the internal Xerces Grammars and methods to do validation.



to read the API but I find it not very describing.

I use Xerces-J 1.2.3, with DOMParser to parse the document.
Can anyone  help me ? Or if you have any suggestion of other means to do
this ? Would appreciate examples a lot..


Since Xerces-j does not have this capability today, you could re-parse with "validation on" the XML document that you are editing. In previous encarnations of the parser (XML4J 2.1.15) there used to be a Revalidating DOM parser that you could use to do "write validation".


Some other people in the past have approached this problem and written their solutions, you may be able to find some of those in the mail archives.

Those solution require detailed internal knowledge of the parser, beyond the public API.

Hope this helps,

                     Jeffrey Rodriguez



Thanks Honest


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


_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com



Reply via email to