• <tfoot id='YaHk9'></tfoot>
    <i id='YaHk9'><tr id='YaHk9'><dt id='YaHk9'><q id='YaHk9'><span id='YaHk9'><b id='YaHk9'><form id='YaHk9'><ins id='YaHk9'></ins><ul id='YaHk9'></ul><sub id='YaHk9'></sub></form><legend id='YaHk9'></legend><bdo id='YaHk9'><pre id='YaHk9'><center id='YaHk9'></center></pre></bdo></b><th id='YaHk9'></th></span></q></dt></tr></i><div id='YaHk9'><tfoot id='YaHk9'></tfoot><dl id='YaHk9'><fieldset id='YaHk9'></fieldset></dl></div>

    1. <small id='YaHk9'></small><noframes id='YaHk9'>

        <legend id='YaHk9'><style id='YaHk9'><dir id='YaHk9'><q id='YaHk9'></q></dir></style></legend>

        • <bdo id='YaHk9'></bdo><ul id='YaHk9'></ul>

        在 C++ 中生成 xml 的最简单方法是什么?

        what#39;s the easiest way to generate xml in c++?(在 C++ 中生成 xml 的最简单方法是什么?)
            <bdo id='oCCRs'></bdo><ul id='oCCRs'></ul>

          • <i id='oCCRs'><tr id='oCCRs'><dt id='oCCRs'><q id='oCCRs'><span id='oCCRs'><b id='oCCRs'><form id='oCCRs'><ins id='oCCRs'></ins><ul id='oCCRs'></ul><sub id='oCCRs'></sub></form><legend id='oCCRs'></legend><bdo id='oCCRs'><pre id='oCCRs'><center id='oCCRs'></center></pre></bdo></b><th id='oCCRs'></th></span></q></dt></tr></i><div id='oCCRs'><tfoot id='oCCRs'></tfoot><dl id='oCCRs'><fieldset id='oCCRs'></fieldset></dl></div>

            <small id='oCCRs'></small><noframes id='oCCRs'>

            <legend id='oCCRs'><style id='oCCRs'><dir id='oCCRs'><q id='oCCRs'></q></dir></style></legend>
                <tbody id='oCCRs'></tbody>
                <tfoot id='oCCRs'></tfoot>

                  本文介绍了在 C++ 中生成 xml 的最简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我使用了 boost 序列化,但这似乎不允许我生成符合特定模式的 xml——它的目的似乎只是为了保持类的状态.

                  I've used boost serialization but this doesn't appear to allow me to generate xml that conforms to a particular schema -- it seems it's purpose was to just to persist a class's state.

                  平台:linux

                  你们用什么来生成 NOT 解析 xml?

                  What do you guys use to generate NOT parse xml?

                  到目前为止,我正在沿着 Foredecker 的路线自行生成它——它不是一个大文档,但我真的不应该在找到一个合适的库来正确生成它时遇到这么多麻烦.

                  So far I'm going down Foredecker's route of just generating it myself -- it's not a large document but I really shouldn't be having this much trouble finding a decent library to generate it correctly.

                  至于提升,我希望能够做的事情是设置节点名称,在我的节点中设置属性,并摆脱它带来的所有额外废话,因为我并不真正关心不得不把我的文档放回那个班级.

                  As for boost, the things that I would like to be able to do is set the node names, set attributes in my nodes, and get rid of all the extra crap that comes with it as I don't really care about having to put my document back into that class.

                  推荐答案

                  有些人可能会宣称我是 XML 异端——但一种有效的方法是使用你最喜欢的字符串输出工具(打印、输出流等)生成它——这个可以转到缓冲区或文件.

                  Some may declare me an XML heretic - but one effective way is to just generate it with your favorite string output tools (print, output streams, etc) - this can go to a buffer or a file.

                  一旦保存 - 您真的应该在提交之前使用架构进行验证.

                  Once saved - you really should then validate with a schema before committing it our shipping it off.

                  对于我们的一个项目,我们有一组非常简单的模板来管理开始/结束标签和属性.这些每个都有一个流输出操作符.这使得生成源 XML 和调试变得非常容易.这使得 XML 生成代码的结构看起来非常像 XML 本身.

                  For one of our projects we have a very simple set of templates for managing begin/end tags and attributes. These each have a stream output operator. This makes it very easy to generate the source XML and debug. This makes the structure of the XML generation code look very much like the XML itself.

                  这样做的一个优点是,如果流式传输到文件,您可以高效地生成大量 XML.您将在稍后支付验证费用(大概是在进行昂贵操作的更好时间).

                  One advantage of this is that you can generate large amounts of XML efficiently if streaming to a file. You will pay the validation costs later (presumably at a better time for an expensive operation).

                  这种技术的缺点是它本质上只是输出.它不适合动态创建然后使用 XML.

                  The downside of this technique is that it is essentially output only. It is not suitable for creating then consuming XML dynamically.

                  这篇关于在 C++ 中生成 xml 的最简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Consistent pseudo-random numbers across platforms(跨平台一致的伪随机数)
                  Vary range of uniform_int_distribution(改变uniform_int_distribution的范围)
                  What is a seed in terms of generating a random number?(就生成随机数而言,种子是什么?)
                  Is 1.0 a valid output from std::generate_canonical?(1.0 是 std::generate_canonical 的有效输出吗?)
                  Getting big random numbers in C/C++(在 C/C++ 中获取大随机数)
                  What is the best way to generate random numbers in C++?(在 C++ 中生成随机数的最佳方法是什么?)
                    <bdo id='7Oto9'></bdo><ul id='7Oto9'></ul>
                      <i id='7Oto9'><tr id='7Oto9'><dt id='7Oto9'><q id='7Oto9'><span id='7Oto9'><b id='7Oto9'><form id='7Oto9'><ins id='7Oto9'></ins><ul id='7Oto9'></ul><sub id='7Oto9'></sub></form><legend id='7Oto9'></legend><bdo id='7Oto9'><pre id='7Oto9'><center id='7Oto9'></center></pre></bdo></b><th id='7Oto9'></th></span></q></dt></tr></i><div id='7Oto9'><tfoot id='7Oto9'></tfoot><dl id='7Oto9'><fieldset id='7Oto9'></fieldset></dl></div>

                      <small id='7Oto9'></small><noframes id='7Oto9'>

                        <tbody id='7Oto9'></tbody>

                        <tfoot id='7Oto9'></tfoot>
                      1. <legend id='7Oto9'><style id='7Oto9'><dir id='7Oto9'><q id='7Oto9'></q></dir></style></legend>