Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: Thu Apr 25 16:36:21 CEST 2024

Total time taken to generate the page: 0.02842 seconds