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

查看:164
本文介绍了在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天全站免登陆