Can I enforce the order of XML attributes using a schema?

后端 未结 8 1917
囚心锁ツ
囚心锁ツ 2020-12-06 10:01

Our C++ application reads configuration data from XML files that look something like this:


 

        
8条回答
  •  长情又很酷
    2020-12-06 10:37

    As others have pointed out, no, you can't rely on attribute ordering.

    If I had any process at all involving 2,500 XML files and 1.5 million key/value pairs, I would get that data out of XML and into a more usable form as soon as I possibly could. A database, a binary serialization format, whatever. You're not getting any advantage out of using XML (other than schema validation). I'd update my store every time I got a new XML file, and take parsing 1.5 million XML elements out of the main flow of my process.

提交回复
热议问题