在 XML 中,属性顺序重要吗? [英] In XML, is the attribute order important?

查看:26
本文介绍了在 XML 中,属性顺序重要吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个生成几个 XML 文件的应用程序.在文件中,一些标签具有属性.我想知道属性的顺序是否重要,还是一样.

I'm writing an application that produces a couple of XML files. In the files, some of the tags have attributes. I'd like to know if the order of the attributes is important, or it's the same.

例如,这个输出:

<person first='john' last='doe'>

和这个是一样的:

<person last="doe" first="john">

推荐答案

根据XML规范,不重要.

According to the XML specification, it is not important.

开始标签或空元素中属性规范的顺序标签不重要

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

请参阅此处提供的规范中的第 3.1 节:http://www.w3.org/TR/REC-xml/

See section 3.1 in the specification available here: http://www.w3.org/TR/REC-xml/

这篇关于在 XML 中,属性顺序重要吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆