Mac 中的 PLIST(属性列表)是否必须使用制表符/缩进?
我已经创建了一个 PLIST。 PLIST的结构是这样的
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://10.87.145.105:8080/copy/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>title</key>
<string>Sample</string>
<key>title.short</key>
<string>Sample1</string>
</dict>
</plist>
这在Mac/iPhone中不被识别为plist。 如果我删除那个额外的选项卡并进行相同的缩进,它可以在 mac 和 iPhone 中使用。 如下所示的缩进是 MAC 或 iPhone 识别该文件所必需的。
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://10.87.145.105:8080/copy/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>title</key>
<string>Sample</string>
<key>title.short</key>
<string>Sample1</string>
</dict>
</plist>
I have created a PLIST. The structure of the PLIST is like this
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://10.87.145.105:8080/copy/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>title</key>
<string>Sample</string>
<key>title.short</key>
<string>Sample1</string>
</dict>
</plist>
This is not recognised in Mac/iPhone as a plist.
If i remove that extra tab from and make both and in same indentdation it works in mac and iPhone.
Is this indentation of and as shown below is mandatory for a MAc or iPhone to recognise the file.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://10.87.145.105:8080/copy/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>title</key>
<string>Sample</string>
<key>title.short</key>
<string>Sample1</string>
</dict>
</plist>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是尝试了一下,没有任何区别 - 我认为不应该,我是对的。
Just tried it and it makes no difference whatsoever - thought it shouldn't, and I was correct.
不可以。plist 文件中的空格是可选的。
No. Whitespace is optional in plist files.