U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » problem when parse html with XMLParser
problem when parse html with XMLParser [message #48805] Fri, 22 September 2017 10:40 Go to previous message
akebee is currently offline  akebee
Messages: 90
Registered: August 2011
Location: China
Member
	xml =
		"<html>"
		"<head><meta content=\"always\" name=\"referrer\"></head>"
		"<TITLE>A Midsummer Night's Dream</TITLE>"
		"</html>";
		
	XmlParser p(xml);
	while(!p.IsTag())
		p.Skip();
	p.PassTag("html");
	while(!p.End())
		if(p.Tag("head"))
		{
			while(!p.End()) {
				if(p.TagE("meta")) {
					//  crash here because "<meta" dones`t have "/>"
				}
				else
					p.Skip();
			}			
		}
	
		if(p.Tag("TITLE")) {
			String TITLE = p.ReadText();
			LOG(TITLE);
			p.PassEnd();
		}
		else
			p.Skip();	


the "<meta" in "<head>" dones`t have "/>" so crashed
is there any way to skip "<head>"?
 
Read Message
Read Message
Read Message
Previous Topic: Missing ArrayIndex and AIndex
Next Topic: about some class equivalent to BOOST
Goto Forum:
  


Current Time: Sat Apr 25 16:01:49 GMT+2 2026

Total time taken to generate the page: 0.00678 seconds