[xsd-users] Custom DOMLSParser

Boris Kolpackov boris at codesynthesis.com
Wed Jun 8 10:51:49 EDT 2022


Carlos Wong <carloswong54 at gmail.com> writes:

> But I can only either make the embedded binary representation work or my
> customer error handler. I have run out of ideas, please any feedback and/or
> suggestions would be greatly appreciated.

I tried to follow your code and AFAICS, here is what happens: you call
DOMImplementationRegistry::getDOMImplementation() which returns some
Xerces-provided instance of DOMImplementation. Then you cast it (with
a C-style cast) to your custom_dom_implementation_impl type, even though
it's not. Then you call createLSParser(), which (probably) ends up
calling Xerces' original implementation and you get Xerces' original
DOMLSParserImpl. Or you call createCustomLSParser(), which is wrong,
but by the looks of it, it should return you an instance of your
custom_dom_LS_parser_impl (because it's not a virtual function and
you don't reference any data member).

Why don't you get rid of all this DOMImplementation stuff and create
an instance of your custom_dom_LS_parser_impl directly:

xml::dom::auto_ptr<custom_dom_LS_parser_impl> parser(
  new (manager) custom_dom_LS_parser_impl(0, manager, gramPool));



More information about the xsd-users mailing list