Skip to main content
Known Participant
September 10, 2009
Question

Converting HTML tags to XML Well-Formed tags using AS3

  • September 10, 2009
  • 1 reply
  • 2261 views

Hi all,


I have HTML file, I changed its extension to .XML.


I'd like to convert HTML tags to valid XML document using AS3.


Any ideas? Please participate.

This topic has been closed for replies.

1 reply

September 10, 2009

If your HTML content is well formed and You don't have a <!DOCTYPE HTML > tag then your can directly use it as an XML.

And it will also be well formed.

Why you need it to be edited in AS3?

September 10, 2009

Please check the Following HTML file content.

If set its extension to .xml it will act like an XML file while if you set its extension to HTML it will act like HTML.

Notice that Every tag has an end tag attached to it and HTML is the root tag for all.

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Author" CONTENT="SwapnilVJ"/>
</HEAD>
<BODY>
<h1>This is my heading....</h1>
<img src="sample.gif" alt="This is the tooltip" />
</BODY>
</HTML>

moorawayAuthor
Known Participant
September 10, 2009

I'm dealing with HTTML not XHTML.


So there are tags like <img> and <input>, they don't have a closed tag.


How can I check the file, if the tag dosen't have closed tag, it adds a closed one.


Also, for the attributes, if the attribute dosen't have quotes "", it will add guotes for it.

Thanks alot for helping me.