William Hunter Active Member Licensed User Longtime User Aug 15, 2016 #1 I am getting incomplete HTML messages as processed by the Mailparser. Is there a way to validate that HTML code is complete/or incomplete. I would like to trap invalid HTML as an error, prior to loading to a WebView. Any help greatly appreciated. Best regards
I am getting incomplete HTML messages as processed by the Mailparser. Is there a way to validate that HTML code is complete/or incomplete. I would like to trap invalid HTML as an error, prior to loading to a WebView. Any help greatly appreciated. Best regards
Erel B4X founder Staff member Licensed User Longtime User Aug 16, 2016 #2 Validating html is a very complicated issue. You can check whether the message includes the closing </html> tag. Upvote 0
Validating html is a very complicated issue. You can check whether the message includes the closing </html> tag.
warwound Expert Licensed User Longtime User Aug 16, 2016 #3 You could try to parse the HTML as XML using my XOM library. If XOM cannot parse the HTML then you know that the HTML is invalid. Upvote 0
You could try to parse the HTML as XML using my XOM library. If XOM cannot parse the HTML then you know that the HTML is invalid.
William Hunter Active Member Licensed User Longtime User Aug 16, 2016 #4 Erel said: Validating html is a very complicated issue. You can check whether the message includes the closing </html> tag. Click to expand... Thank you Erel. I’m finding that trying to load ALL emails received into a WebView to be a daunting tast. I tried your <html> suggestion and find it to be hit and miss. There are some content types/encoding that the Mailparser cannot process correctly. I can, with a few unwanted characters such as =0A stripped out, display acceptably about 85% of messages received. Others come through the Mailparser malformed, or occasionally stripped to a 0 bytes file. When I started I thought this would be a fairly straightforward task, but it turns out not to be so. I think the only way to resolve this issue, would be to update the Mailparser to process all current formats. I don’t know whether this would be easily accomplished, or be a major undertaking. I don’t have the knowledge to do this, otherwise I would give it a try. Erel, perhaps if I have caught you on a good day, you will put your considerable skills to the task. I’m sure a great many of us would appreciate an upgraded Mailparser. I have attached three examples of malformed HTML as processed by the Mailparser. Two are missing <html>, while the third includes <html> with a trailing <. Best regards Attachments RawBodyMicheals.txt.txt RawBodyMicheals.txt.txt 657 bytes · Views: 292 RawBodyTalbots.txt RawBodyTalbots.txt 1.1 KB · Views: 274 RawBodyClassmates.txt RawBodyClassmates.txt 140 bytes · Views: 281 Upvote 0
Erel said: Validating html is a very complicated issue. You can check whether the message includes the closing </html> tag. Click to expand... Thank you Erel. I’m finding that trying to load ALL emails received into a WebView to be a daunting tast. I tried your <html> suggestion and find it to be hit and miss. There are some content types/encoding that the Mailparser cannot process correctly. I can, with a few unwanted characters such as =0A stripped out, display acceptably about 85% of messages received. Others come through the Mailparser malformed, or occasionally stripped to a 0 bytes file. When I started I thought this would be a fairly straightforward task, but it turns out not to be so. I think the only way to resolve this issue, would be to update the Mailparser to process all current formats. I don’t know whether this would be easily accomplished, or be a major undertaking. I don’t have the knowledge to do this, otherwise I would give it a try. Erel, perhaps if I have caught you on a good day, you will put your considerable skills to the task. I’m sure a great many of us would appreciate an upgraded Mailparser. I have attached three examples of malformed HTML as processed by the Mailparser. Two are missing <html>, while the third includes <html> with a trailing <. Best regards
Erel B4X founder Staff member Licensed User Longtime User Aug 17, 2016 #5 warwound said: If XOM cannot parse the HTML then you know that the HTML is invalid. Click to expand... HTML is not XML. XHTML is based on XML but it is not very popular. MailParser was never intended to be a complete client implementation. There are many formats that are not supported. Upvote 0
warwound said: If XOM cannot parse the HTML then you know that the HTML is invalid. Click to expand... HTML is not XML. XHTML is based on XML but it is not very popular. MailParser was never intended to be a complete client implementation. There are many formats that are not supported.