如何在ActionScript3.0中验证xml文件? [英] How to validate an xml file in ActionScript3.0?

查看:113
本文介绍了如何在ActionScript3.0中验证xml文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<note>
<to>ahmad</to>
<from>jhon
<body>hello how are you!!!</body>
</note>


这是我的xml文件,没有 from 标签的结束标签.这是一个错误.
我希望一个动作脚本代码检查是否有损坏的标记,然后自动对其进行修复,因此我的代码显示了正确的xml.

谁能帮助我?

谢谢&问候
Ahmad


This is my xml file that has no ending tag of from tag. This is an error.
I want an actionscript code to check if there is a broken tag then fix it automatically and thus my code displays the correct xml.

Anyone who can help me?

Thanks & Regards
Ahmad

推荐答案

ActionScript 3具有XML类,该类将解析XML以确保格式正确.
如果XML缺少任何标签,它将引发异常.但是它无法使用DTD或任何XML模式进行验证.

详细信息此处 [
ActionScript 3 has XML class which will parse your XML for well-formedness.
It will throw an exception if the XML is missing any tags. But It won''t validate using DTD or any XML schema.

More information here[^]


这篇关于如何在ActionScript3.0中验证xml文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆