从 Web 服务返回的 XML 中包含撇号
我正在使用的 Web 服务在命名空间中包含撇号,这导致 simplexml 出现问题。
例如。 xmlns="Apostrope's here/Foo/Bar"
我尝试过 addslashes
但它似乎不起作用,因为已经返回了包含未转义/编码撇号的字符串并在运行addslashes之前导致错误。
我觉得这是网络服务本身的一个缺陷。我这样想对吗?我确实喜欢正确放置撇号,但在这种情况下似乎麻烦大于其价值。
I am consuming a web service that has an apostrophe contained within the namespace, which is causing problems for simplexml.
eg. xmlns="Apostrophe's here/Foo/Bar"
I've tried addslashes
but it doesn't seem to work because the string has already been returned containing the unescaped/encoded apostrophes and causes an error before addslashes can be run.
It strikes me as being a bit of a flaw within the web service itself. Am I right to think that? I do like a correctly placed apostrophe but it would seem as if it's more trouble than it's worth in this instance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论