0

既存の MSXML DOM パーサーを置き換えることができる Boost プロパティ ツリーを使用して、XML パーサーを作成する必要があります。基本的に、私のコードは子ノードのリスト、子ノードの数などを返す必要があります。これはプロパティ ツリーを使用して実現できますか? 例えば。GetfirstChild()、selectNodes()、Getlength()など。

Boost プロパティ ツリーに関連する多くの API を見ましたが、ドキュメントは最小限でわかりにくいようです。今のところ、BOOST_FOREACH を使用して XML 全体を解析できます。しかし、各ノードへのパスはハードコードされているため、私の目的には役立ちません。

4

1 に答える 1

1

boost::property_tree can be used to parse XML and it's a tree so you can use as XML DOM substitution but the library is not intended to be fully fledged XML parser and it's not complaint with XML standard. For instance it can successfully parse non-wellformed xml input and it doesn't support some of XML features. So it's your choice - if you want simple interface to simple XML configuration then yes, you should use boost::property_tree

于 2014-02-04T15:28:15.853 に答える