【发布时间】:2016-08-06 10:26:48
【问题描述】:
我有一个 AS3 生成的 XML 对象,我想在通过网络将它发送到远程系统之前“最小化”或“缩小”它。
我无法在 AS3 文档中找到任何内容来解决这个问题。我讨论了一个正则表达式替换......但这是一个糟糕的解决方案,容易出现一百万个错误。
有没有人可以推荐的替代方案?
示例(原始):
trace(xml.toString());
<Foo>
<Bar>
<Property>Property One</Property>
<Value />
</Bar>
<Bar>
<Property>Property Two</Property>
<Value>Value Two</Value>
</Bar>
...
...
</Foo>
示例(所需):
trace(minify(xml.toString()));
<Foo><Bar><Property>Property One</Property><Value /></Bar><Bar><Property>Property Two</Property><Value>Value Two</Value></Bar>...</Foo>
【问题讨论】:
标签: xml actionscript-3 flash apache-flex actionscript