为什么xml确实在属性名称之间允许使用空格 [英] why the xml does allow spaces between attribute name

查看:386
本文介绍了为什么xml确实在属性名称之间允许使用空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么xml在属性名称之间不允许使用空格?
我关注的是哪些行不通
< custormer信息日志>
< ..某些数据>
</custormer信息日志>

正在关注的作品
< custormerinformationlogs> //在这里我删除了空白
<某些数据>
</custormerinformationlogs>

Why xml does not allow spaces between attribute name?
I have following which DOES not works
<custormer information logs>
<..Some data >
</custormer information logs>

Following works
<custormerinformationlogs> // Here I removed white space
<Some data>
</custormerinformationlogs>

推荐答案

严格来说< custormerinformationlogs>是可以包含属性的元素名称,例如
< custormerinformationlogs attrib1 = val1 attrib2 = val2>

请注意,属性用空格分隔,如果元素名称在允许的空格处,则会使解析更加复杂
Strictly speaking <custormerinformationlogs> is an element name which can contain attributes e.g.
<custormerinformationlogs attrib1=val1 attrib2=val2>

notice that the attributes are separated with spaces, if element names where allowed spaces this would make parsing more complex


这篇关于为什么xml确实在属性名称之间允许使用空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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