【发布时间】:2016-11-09 17:13:52
【问题描述】:
我想在 smack Message 中添加节点元素。
例如。 <myID> 是我想在消息中添加的自定义标签。像下面的结构
<message to='username@domain' id='12345'><body>Hello</body><myID>33e6cf03-90aa-4281-a36e-902ccdf0657f</myID></message>
到目前为止我尝试了什么通过实现DefaultExtensionElement 创建CustomExtension,但这里它的创建消息指定了一些命名空间。
<message to='username@domain' id='12345'><body>Hello</body><myID xmlns='somenamespace'>33e6cf03-90aa-4281-a36e-902ccdf0657f</myID></message>
但我想添加 without 命名空间作为元素。
有什么帮助吗?
我检查了已经提出和回答的问题,但都带有命名空间。
【问题讨论】: