【发布时间】:2013-02-28 02:25:08
【问题描述】:
我有一个 xsd 文件,我想在属于它的 xml 上迭代抛出一个特殊属性 (Here is my xsd)。通过如下代码合成创建我的类后:
xsdcxx cxx-tree --root-element percolator_output --generate-polymorphic --namespace-map http://per-colator.com/percolator_out/14=xsd pout.xsd
我的主要内容如下:
int main (int argc, char* argv[])
{
try
{
auto_ptr<percolator_output> h (percolator_output_ (argv[1]));
//-----percolator_output::peptides_optional& pep (h->peptides ());
for (peptides::peptide_const_iterator i (h->peptides ().begin ()); i != h->peptides ().end (); ++i)
{
cerr << *i << endl;
}
}
catch (const xml_schema::exception& e)
{
cerr << e << endl;
return 1;
}
}
我想在我的 xml 文件中迭代 throw 属性“peptides”,但 h->peptides () 的输出是 percolator_output::peptides_optional,它不能迭代。
【问题讨论】:
标签: c++ xml codesynthesis