开发者

Better way to escape braces in E4X?

I have some XML I'm generating with {} characters, which are of course used for substitution.

It's hard to find any info on this: MDC is usually great documentation, but it doesn't mention anything about how to put brace literals in an E4X ex开发者_StackOverflow社区pression.

I finally found someone who had an answer: escape { } as { }. But it's really awkward to use. Is there any other way?


Perhaps the cleanest method I can see is to substitute the braces in!

var text:String = "some {text} with {braces}";
var xml:XML = <something>{text}</something>;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜