gpt4 book ai didi

xml - Internet Explorer 以随机顺序显示 XML 属性

转载 作者:数据小太阳 更新时间:2023-10-29 01:57:34 24 4
gpt4 key购买 nike

我正在 Internet Explorer(9、Windows 7 64 位)中打开一个 xml 文件。

Internet Explorer 喜欢以随机顺序显示元素属性,例如:

enter image description here

而不是声明的顺序:

<ApplicationVersion major="2" minor="2" release="12" build="687">2.2.12.687</ApplicationVersion>

例如:

enter image description here

或者

enter image description here

而不是:

enter image description here

是否有任何元素、属性、xml-dtd、xml-schema、Internet Explorer 选项、Windows 选项指示 IE 以声明的方式而不是随机顺序显示 XML?

最佳答案

属性按照 xml 标准的定义是无序的。

来自标准:

Note that the order of attribute specifications in a start-tag or empty-element tag is not significant.

http://www.w3.org/TR/REC-xml/#sec-starttags

如果您需要属性的顺序,您将不得不更改您的标记。我建议如下:

<ApplicationVersion>
<attribute name="major">2</attribute>
<attribute name="minor">2</attribute>
<attribute name="build">687</attribute>
</ApplicationVersion>

链接:
Order of XML attributes after DOM processing
Can I enforce the order of XML attributes using a schema?

关于xml - Internet Explorer 以随机顺序显示 XML 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10317671/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com