带撇号的 ExpressionEngine 成员导入 XML 错误
我正在尝试将大约 2000 个成员导入到 Expression Engine 中。我花了 3 天将数据精炼成 XML。该文档目前已超过 40,000 行。
问题是,某些值包含撇号(用户名、屏幕名称和电子邮件地址) - 看起来像这样...
<username>BobO'Leary</username>
<screen_name>BobO'Leary</screen_name>
<email>bob.O'[email protected]</email>
这会生成以下错误
Username contains illegal characters. (Username: 'BobO'Leary' - within user record 'BobO'Leary')
The email you submitted is not valid (Email: 'Bob.O'[email protected]' - within user record 'BobO'Leary')
我尝试将 ' 替换为 ' ;和 &apos ; 没有成功。
我不是 XML 专家,所以肯定有一些我遗漏的东西。 非常感谢任何帮助!
I am attempting to import to about 2000 members into Expression Engine. I have spent 3 days refining the data into XML. The document now weighs in at over 40,000 lines.
The problem is, some values contain apostrophes (username, screen_name and email address) - which look something like this...
<username>BobO'Leary</username>
<screen_name>BobO'Leary</screen_name>
<email>bob.O'[email protected]</email>
This generates the following errors
Username contains illegal characters. (Username: 'BobO'Leary' - within user record 'BobO'Leary')
The email you submitted is not valid (Email: 'Bob.O'[email protected]' - within user record 'BobO'Leary')
I have attempted to replace the ' with ' ; and &apos ; with no success.
I am not an XML expert, so there must be something I am missing.
Any help much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是 XML 问题,而是 EE 问题 - 用户名中不能包含撇号或任何特殊字符。因此,您需要将
节点中的所有撇号替换为空格、破折号、下划线、句点或仅替换为空。This isn't an XML issue, but an EE issue - usernames can't have apostrophes or any special characters in them. So you'll need to replace all apostrophes within the
<username>
nodes with either a space, dash, underscore, period, or just nothing.也许你应该尝试使用 CDATA
Maybe you should try to use CDATA