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 » XML parsing error
Re: XML parsing error [message #16856 is a reply to message #16850] Thu, 17 July 2008 15:50 Go to previous messageGo to previous message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
TeCNoYoTTa wrote on Wed, 16 July 2008 18:30

thanks very much ......i appreciate your help
but please tell me what these functions do
  • Xml_File.End()
  • Xml_File.PassEnd()
  • Xml_File.Skip()



I agree with you on some confusion with the xml parsing functions.
Unfortunately, my gripe with the xml parser is that it requires a lot of code to make it work correctly.

  • The End() function checks to see if the current token is an ending tag (Ie. </day>). At the same time, it will advance to the next token.
  • The PassEnd() function calls End(). So it expects that you already known that the current token is an ending tag and you want to pass it and go to the next token. If it is not an ending tag, then it throws an exception.
  • The Skip() function skips tokens till the next tag is reached, skipping over the ending tags as you go.

Note, tags specified like: <singletag attr1="value"/> will register as true for being an ending tag!
I was able to account for this through loops like:
XmlParser xp(xmlstr);
...
while(!xp.End()){
    if(xp.Tag("mytag")){
        //read attributes from tag
        if(xp.IsEnd()){xp.PassEnd();} //this checks for singletag case
    }else{ xp.Skip(); }
}


I wish there was a way to just convert an entire xml string into a hierarchy of vector/vector-maps! Maybe I'll work on one.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NULL
Next Topic: XMLNode error
Goto Forum:
  


Current Time: Wed May 08 05:40:11 CEST 2024

Total time taken to generate the page: 0.02384 seconds