本文介绍了Xerces-C中的XPath支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在支持使用Xerces-C进行XML解析的旧版C ++应用程序.我被.Net宠坏了,习惯了使用XPath从DOM树中选择节点.

I am supporting a legacy C++ application which uses Xerces-C for XML parsing. I've been spoiled by .Net and am used to using XPath to select nodes from a DOM tree.

是否有任何方法可以访问Xerces-C中某些有限的XPath功能?我正在寻找类似selectNodes("/for/bar/baz")的东西.我可以手动执行此操作,但是相比之下,XPath非常好.

Is there any way to get access some limited XPath functionality in Xerces-C? I'm looking for something like selectNodes("/for/bar/baz"). I could do this manually, but XPath is so nice by comparison.

推荐答案

请参见xerces常见问题解答.

See the xerces faq.

http://xerces.apache.org/xerces-c/faq-other-2.html#faq-9

Xerces-C ++是否支持XPath?No.Xerces-C ++ 2.8.0和Xerces-C ++ 3.0.1仅出于处理模式身份约束的目的而具有部分XPath实现.要获得XPath的全面支持,您可以参考Apache Xalan C ++或其他开放源代码项目,例如Pathan.

Does Xerces-C++ support XPath?No.Xerces-C++ 2.8.0 and Xerces-C++ 3.0.1 only have partial XPath implementation for the purposes of handling Schema identity constraints. For full XPath support, you can refer Apache Xalan C++ or other Open Source Projects like Pathan.

但是使用xalan可以很轻松地完成您想要的事情.

It's fairly easy to do what you want using xalan however.

这篇关于Xerces-C中的XPath支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 19:21