Ecere SDK/eC Forums • View topic - XMLParser




Ecere SDK/eC Forums

Ecere Developers Community

XMLParser

Discussions relating to the eC language: wished features, work under development, and other improvements.

XMLParser

Postby fedor_bel » Thu Apr 08, 2010 4:22 am

Dear Jerome,
Is the XMLParser in the extras section complete? It seem to be a work in progress. I have found some unclear moments in it for me when trying to use it and debugging through it. It calls ProcessKeyword for opening and closing tags, sending just the tag name as a parameter. What is a possible use for it?
Does it understand the starting <?xml version="1.0" encoding="utf-8" standalone="no"?> line? Should not we have a more useful and powerful parser? And the very last question, which started to bother me recently: why would we need to wright our own parser in the first place, when this task has already been completed by numerous other programmers in the world? I dont like reinventing the bycicle.
Cheers,
Fedor
fedor_bel
 
Posts: 21
Joined: Sun Mar 14, 2010 4:46 pm

Re: XMLParser

Postby jerome » Mon Apr 12, 2010 9:42 pm

Hi Fedor, sorry for the late reply.

The XMLParser (and everything else in the extras) is what it is.
It comes with no warranty of completeness, usability or fitness of purpose of any kind (in fact the same applies for the whole SDK, but even more so for the extras).

If you look at samples/net/XMLSample you will find a sample use for it.
I'm not a big fan of XML myself, I much prefer JSON which I adopted for the IDE's project files (the new .epj version).

By calling GetWord() and looking at the 'word' string you can go through the various elements inside the tags.

I guess you simply missed that sample (fairly enough, having no indication about it :) )
Perhaps we should point to it in the XMLParser.ec file.

The reason for having our own parser is because it is a very simple task that can be accomplished in just a few lines of eC code, and mainly because I didn't want to rely on anyone else's code.
It is up to you to use whichever parser you like (e.g. libexpat is a decent one), or write your own more powerful XML parser, based on XMLParser.ec or from scratch.

As for reinventing the bicycles, we humans really don't invent anything. We just discover things that the Universe put there for us to discover and guided us to discover.

Cheers :)

Jerome
jerome
Site Admin
 
Posts: 614
Joined: Sat Jan 16, 2010 11:16 pm


Return to eC Language

Who is online

Users browsing this forum: No registered users and 1 guest

cron