如何在xml中添加感叹号[!]? [英] How to add Exlamation mark [!] in xml?

查看:259
本文介绍了如何在xml中添加感叹号[!]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我创建一个应用程序.在其中使用Treenode.对于父节点和子节点,通过xml fiile获取名称.父树节点的名称.但是.当我必须写< Plus!>时.在xml中然后发生错误.我为它编写了0x21 ASCII代码,它不被接受.

如何写!,#,&在xml文件中?

Hello,

I create a application.In that use the Treenode .For parent node and child node fetch the names through xml fiile.Now I want to give "Plus!" name for parent tree node.But.When i have to write <Plus!> in xml then error get occured.Same for also instead of ! i write 0x21 ASCII code for it its not accept.

How to write !,#,& in xml file?

推荐答案

您不能在元素名称中使用该字符.元素名称必须以字母或下划线开头.之后,还可以使用数字,句点,连字符和下划线.冒号也可以用于命名空间,不能使用其他字符.另外,不允许以"xml"开头的名称.

祝您好运!
You can''t use that character in element names. Element names need to start with a letter or underscore. After that, digits, period, hyphen and underscore are also allowed. Colon can also be used and for namespaces.Other characters can''t be used. Also, starting the name with "xml" isn''t allowed.

Good luck!


您的问题是错误的,因为您可以在xml文件中使用任何unicode字符,但不能以任何角色使用.
XML元素标记必须是xml规范中定义的名称: http ://www.w3.org/TR/REC-xml/#NT-名称 [ ^ ].如我所见,您的不祥字符都不符合.
Your question is wrong, because you can use any unicode character in an xml file, but not in any role.
XML element tag has to be a name as defined in the xml specification: http://www.w3.org/TR/REC-xml/#NT-Name[^]. As I see, neither of your ominous characters comply.


这篇关于如何在xml中添加感叹号[!]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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