[Gambas-devel] XML component, expat

Christian Faure christian.faurebouvard at ...156...
Mon Sep 13 00:46:16 CEST 2004


El Domingo, 12 de Septiembre de 2004 18:18, ron escribió:
> On Friday 10 September 2004 17:35, Christian Faure wrote:
> > Hi Benoit
> > Happy birthay!
> > (after somes days... Sorry)
> >
> > > Look at the previous posts of Christian Faure. It works on a xml
> > > component, but based on the expat library.
> > >
> > > I suggest you contact you so that you share your works. You can work on
> > > the same library, on make twice the same component with two differents
> > > libraries (gb.xml.expat and gb.xml.tinyxml).
> > >
> > > When Christian and/or you have finished the components, I will come to
> > > ensure that their interface is nice, and, if you do two different
> > > components, that they are exactly the same :-)
> >
> > Ok, Finished!  (for now)
> > Attached files contain a snapshot of the directory of my "expatc"
> > component, and a very simple example ( only print to console) in gambas.
> >
> > 1. Makefiles
> > I'm not a Guru of autoconf nor automake,
> > so the Makefile, Makefile.in, Makefile.am need to be generic,
> > it reffers to absolute path on my machine!
> > This makefile also generate the .info and install them
> >
> > I'v seen in a previous post a How-to to implement a new component,
> > but for te next version....
> >
> > 2. Requirements: expat library installed
> > (i don't know the size of this)
> >
> > 3. The code:
> > When method Parse(filename) is called the parser
> > open file, parse and fire the correspondig gambas-events.
> > Principals events are:
> > StartElement, ChararcterData, EndElement
> >
> > 4. Others
> > In gambas (small bug?), the text editor replace "?" by "PRINT"
> > so you can't edit  XML files
> > The Attribute parameter of StartElement is declared as "o" Object
> > in the signature, How can declare it as Collection?
> >
> > > Regards,
>
> I did a try of it.
> The example instructions from the wiki or yours did not work very well.
> I add the GB_COMPONENT and expand the AC_??? part as told.
> The .info was not made, so I dropped the symlinks as in the wiki
> and did a reconf, configure, make and make install to be sure all was
> done.
Sorry, the attached file is only a snapshot of my directory, must be placed at 
same tree (gambas-0.96) in: /usr/local/src/gambas-0.96/src/lib/expatc
The makefile possibly fail on other machine.
>
> It worked but gives a error on the line with the comment in test.xml
Can't parse?

> Nice to play with but I hope the libxml will deliver a DOM tree object.

Daniel Campos has built one called "gbxml", it uses libxml2, and load the tree 
structure
see post "example comonent" of "Daniel" date 08-08-2004

>
> As a simple component example, i can learn from it :)

Regards,
Christian

Christian




More information about the Devel mailing list