开发者

How do I validate and repair broken xml tags?

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

Above i开发者_StackOverflows my xml file which has no ending tag for the from tag, which gives an error. I need actionscript code to check if there is a broken tag and then fix it automatically.


I believe the only way you could do this is by analyzing the text of the XML document before attempting to convert it into an XML object. This really isn't ideal and it would be much better if you could validate the XML before attempting to bring it into Flash. You could possibly do this by using one of the many online XML validators or server side scripts to check the document. I also found this implementation of a validator in AS3 which might be useful.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜