Xerces-C: transition from v2.x to v3.x?

I would like to migrate a project (legacy code that I did not quite understand) from Xerces-C v2.x to v3.x.

It turns out Xerces-C v3 removed the DOMBuilder class. The archive tells me the following:

... several DOM interfaces (DOMBuilder, DOMWriter, DOMInputSource, etc.) have been replaced as part of the final specification for compliance with the DOM level 3 specification.

It's good. But is there any guide for porting code that relies on these classes for the new API?

+6
c ++ xml api upgrade xerces-c
source share
1 answer

Substitutions for remote APIs:

  • Use XercesDOMParser or DOMLSParser instead of DOMBuilder ( more ):

    xercesDOMParser-> setCreateCommentNodes (true);

  • Use the DOMLSSerializer instead of the DOMWriter :

    DOMLSSerializer * writer = ((DOMImplementationLS *) impl) → createLSSerializer (); DOMConfiguration * dc = writer-> getDomConfig (); DC-> setParameter (XMLUni :: fgDOMErrorHandler, ErrorHandler); DC-> setParameter (XMLUni :: fgDOMWRTDiscardDefaultContent, true);

  • Use DOMLSInput instead of DOMInputSource .

See also:

+11
source share

All Articles