[Gambas-user] New XML component

Adrien Prokopowicz adrien.prokopowicz at ...626...
Wed Apr 25 02:06:02 CEST 2012


Le lundi 23 avril 2012 12:05:13 Caveat a écrit :
> Benoit and Fabien, you're both right of course.
> 
> Sorry, I was a little frustrated by how broken gb.xml now appears to be.
> 
> The project I've sent does allow you guys to get some serious testing in
> and I'm here should you have any questions about the project and the
> code.
> 
> There are plenty of simple xml examples out on the web, the beauty of my
> project is that it *should* be generic enough to read pretty much any of
> those xml examples either from file or from string and doesn't have to
> be told about specific tags...
> 
> Regards,
> Caveat
> 

With the revision #4669, your projects (the 3 forms i tested) work perfectly 
on my side, with the Heroes.xml file. 
I just had to make a little modification, i think that was why the reader 
appeared broken (in XmlParserToModel:171, and :200) : 

If reader.Node.Type = XmlReaderNodeType.EndElement

This didn't work because reader.Node.Type never returns EndElement. It is 
logical : EndElement is a State (the reader state) and reader.Node.Type is a 
node type. So you should use the reader.State property instead : 

If reader.State = XmlReaderNodeType.EndElement

(Yes, the XmlReaderNodeType class should be renamed, but I can't, for 
compatibility reasons ... )

Regards,
Adrien.




More information about the User mailing list