Hi,
Am Freitag, 27. August 2004 20:15 schrieb Andy Clark:
> Volker Katz wrote:
> > I have to validate a SAX-stream against a XML-Schema. My plan was
> > to implement a custom ContentHandler which sends all SAX-events to
> > the parser. Therefore I used an instance of
> > org.apache.xerces.parsers.SAXParser, because this class implements
> > alls SAX-events.
[...]
> I don't think that this will work. The Xerces SAXParser parses
> input streams, not SAX streams. The fact that the SAXParser
> implements XMLDocumentHandler (which is similar to ContentHandler)
> does *not* mean that you can route SAX events to it. The parser
> class is the *end* of the parsing process, not the beginning.
ok, that's not really surprising for me. Because of all the interfaces 
and abstract classes understanding the code is very difficult for me, 
so I just made a test. 

> However...
> We designed XNI to be modular. So it is possible to replace the
> scanner at the beginning of the pipeline with a SAX->XNI converter
> that routes your SAX-stream to the subsequent stages in the
> pipeline (e.g. XML Schema validator, etc). You would need to
> write your own parser configuration for this setup, though.
ok, I allready thought about this possibility of writing my own 
configuration. But I hoped, that this isn't necessary....

> This type of parser configuration has not been written for Xerces,
> yet, but I wrote the SAX->XNI converter component for a previous
> project. If you want to try to implement this configuration, let
> me know and I'll point you to that code. And, if you do write it,
> it would be great if you could donate it back to the project so
> that other people can use it.
Howevery, I think I have to implement this configuration.... I would be 
great, if you point me to that code and perhaps give me some 
assistance. 

Thank you very much!
Best regards
  Volker

-- 
Gruß & Danke
  Volker



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

Reply via email to