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

后端 未结 1 571
感动是毒
感动是毒 2021-01-18 02:14

I would like to migrate a project (legacy code which I am not quite familiar with) from Xerces-C v2.x to v3.x.

It turns out that Xerces-C v3 dropped the DOMBuilder c

相关标签:
1条回答
  • 2021-01-18 02:57

    Replacements for removed APIs:

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

      xercesDOMParser->setCreateCommentNodes(true);

    • Use DOMLSSerializer instead of 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:

    • "Xerces-C++ API Reference 3.1.1"
    • "Xerces-C++ API Reference 2.8.0"
    0 讨论(0)
提交回复
热议问题