Xerces-C:从 v2.x 迁移到 v3.x? [英] Xerces-C: Migration from v2.x to v3.x?

查看:25
本文介绍了Xerces-C:从 v2.x 迁移到 v3.x?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个项目(我不太熟悉的遗留代码)从 Xerces-C v2.x 迁移到 v3.x.

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

事实证明,Xerces-C v3 删除了 DOMBuilder 类.迁移档案告诉我:

It turns out that Xerces-C v3 dropped the DOMBuilder class. The migration archive tells me this:

...许多 DOM 接口(DOMBuilder、DOMWriter、DOMInputSource 等)被替换为最终 DOM Level 3 规范一致性工作的一部分.

...a number of DOM interfaces (DOMBuilder, DOMWriter, DOMInputSource, etc.) were replaced as part of the the final DOM Level 3 specification conformance work.

那很好.但是有没有关于如何将依赖于这些类的代码迁移到新 API 的指南?

That's nice. But is there any guide on how to migrate code that relies on these classes to the new API?

推荐答案

已移除 API 的替换:

Replacements for removed APIs:

  • 使用 XercesDOMParserDOMLSParser 而不是 DOMBuilder (更多信息):

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

xercesDOMParser->setCreateCommentNodes(true);

xercesDOMParser->setCreateCommentNodes(true);

  • 使用 DOMLSSerializer 而不是 DOMWriter:

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

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

  • 使用 DOMLSInput 而不是 DOMInputSource.

    另见:

    这篇关于Xerces-C:从 v2.x 迁移到 v3.x?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆