开发者

Problem with special characters Flash to XML

By sending the below text block from Flash there are problems w开发者_开发百科ith the through PHP created XML output.

( ) * + , - . / 0 1 ! # % ‚ 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ a b c d e ...

I think some of the characters causing the problem. How to fix this problem? Cheers


Not all standalone characters are supported as valid XML, specifically

  • Left Angle Bracket (<)
  • Right Angle Bracket (>)
  • Double Quote (")
  • Apostrophe (')
  • Ampersand (&)

So if any of your input contains that and you're just trying to shove it into the XML, then you're going to get malformed XML. You need to run your input through a conversion function (htmlspecialchars).

Or you could, as The_asMan suggested, wrap all of your input in a CDATA section. Your text won't be parsed as XML that way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜