带撇号的 ExpressionEngine 成员导入 XML 错误

发布于 2024-12-14 15:09:22 字数 923 浏览 3 评论 0原文

我正在尝试将大约 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')

我尝试将 ' 替换为 &#39 ;&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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

在你怀里撒娇 2024-12-21 15:09:22

这不是 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.

鸢与 2024-12-21 15:09:22

也许你应该尝试使用 CDATA

<username><![CDATA[BobO'Leary]]></username>

Maybe you should try to use CDATA

<username><![CDATA[BobO'Leary]]></username>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文