Hi Windy, Before calling normalizeDocument() you should be able to set the "http://apache.org/xml/properties/internal/grammar-pool" property on the DOMConfiguration with your grammar pool. Alternatively you could use the JAXP Validation API [1]. If you pass the PSVI-aware version of the DOM to the Validator [2] as both the Source and Result it will annotate your DOM with PSVI.
Thanks. [1] http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/package-summary.html [2] http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/Validator.html#validate(javax.xml.transform.Source,%20javax.xml.transform.Result) Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] "Windchime" <[EMAIL PROTECTED]> wrote on 12/11/2007 12:30:30 PM: > I am reading lots of XML documents that need schema validation. However, I > don't know what the schema (actually grammar pool) looks like until long > after the documents are read. Finally, I want to have full access to the > PSVI information. > > What I would like to know is, is there any way to perform the schema > validation without reparsing the XML. The reparse causes two problems: > 1) Takes time > 2) All cached Element references must be re-cached > > The code that I have generally works just fine, except that I must reparse > the DOM a second time once the grammar has been determined. > > In priority order, it would be great if I could: > > * Somehow associate the grammar pool and then just call > normalizeDocument() [ I already have a PSVIDocument using the > 'http://apache.org/xml/properties/dom/document-class-name' property ] > > * Use an input source that would preserve the original DOM > > > > Thanks much in advance, > > > -Windy > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]