XInclude exceptions - how to mirror Xerces J functionality into Xerces C++? 2007-02-04 - By Simon Rowland
Michael Glavassevich wrote: > Hi Simon, > > Simon Rowland <srowlandx11@(protected)> wrote on 02/03/2007 05:45:21 PM: > > The XInclude spec doesn't say but the various XML APIs (SAX, DOM, JAXP, > StAX, etc...) do specify how errors are reported. Xerces-J's internal > error reporting mechanism was designed so that it could support them. This > includes reporting the error to a registered error handler and throwing an > exception with location information (e.g. SAXParseException and > XMLStreamException) up to the application if the error was fatal or if the > error handler threw an exception. If you're planning to add XInclude > support to Xerces-C++ as a new SAX/DOM parser feature [1] and/or as a new > parameter [2] for DOM normalization [3] you should use the error reporting > mechanisms which already exist for these APIs. > > > [1] http://xerces.apache.org/xerces2-j/features.html#xinclude > [2] > http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/DOMConfiguration .html > [3] > http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/Document.html #normalizeDocument() > >
Thanks Michael, I really appreciate the reply. In the xerces c case, the standard DOMParser to which I am adding xi as a feature can either report errors through the clients errorHandler, which takes a DOMException, or throw XMLException, which the client is expected to catch.
I'm currently favouring adding an XMLException, since extending DOMException seems to go against its pretty tight spec: http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-17189187 Several other modules inside the DOMParser e.g. platform utils etc extend the XMLException too, so it seems inkeeping.
I've asked on c-dev too.
Thanks again for the help, Simon.
> Michael Glavassevich > XML Parser Development > IBM Toronto Lab > E-mail: mrglavas@(protected) > E-mail: mrglavas@(protected) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: j-dev-unsubscribe@(protected) > For additional commands, e-mail: j-dev-help@(protected) > >
--------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscribe@(protected) For additional commands, e-mail: j-dev-help@(protected)
|
|