Joseph Kesselman wrote: > > In this case you need to register on the RevalidationHandler a > > documentHandler. This can be done by calling > > revalidationHandler.setDocumentHandler (since revalidation handler > also > > implements the XMLDocumentSource). > > ... I'm confused. I don't see anything called "revalidationHandler" in > the DOMNormalizer/CoreDocumentImpl pair. Could you be a bit more > specific?
The DOMNormalizer holds a reference to a revalidation handler (fValidationHandler) which is XMLSchemaValidator. (The XMLSchemaValidator implements impl.RevalidationHandler interface). The revalidation handler is just another DocumentHandler interfaces that allows to pass document events to validators. > I'd still really like to have a simple example of assembling XNI > components into a Configuration that would show me how to take my > XMLDocumentScanner and XML*Handlers and hook them up on either side of > a validation. I have doubts that it is useful to have such configuration in Xerces. We can't know what data model you will be using, so you would need to add and re-implement several methods, in particular: Create/add document scanner: you need to write your own scanner for your data model. That will take as an input some data structure in memory, walk it and omit RevalidationHandler events to the next component. configurePipeline(): to configure pipeline scanner--> revalidation handler --> document handler parse (): it takes as a parameter an InputSource/or String, so you need to add another method that allows to set your data model object on the configuration, and use that model to pass to your scanner when the parse() method is called. Btw, you can see that in the pipeline I did not include the namespace binder. This is because, the namespace binder does a lot of work you don't need to do (like binding namespace to attributes/elements). Given that binding is already performed in your tree, you should not use this component, but instead your scanner should issue appropriate namespace events (i.e. startPrefixMapping) About configurations: the util.ParserConfigurationSettings class is the basic configuration. I think the best configuration for you to extend is dom.DOMRevalidationConfiguration. It allows to set properties and features, but it does not have any components, which you can add: your scanner, revalidation handler (XMLSchemaValidator), and your document handler. I have a question for you -- how do you actually create DTM tree? I hope it is done from XNI events...? Hope it helps, -- Elena Litani / IBM Toronto --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
