On Wed, 2007-01-10 at 11:29 +0100, Max CtRiX wrote:
> Jeffrey C. Ollie wrote:
>  > I've been pretty quiet on the lists for a while, but why are we adding
>  > an XML parser to OpenPBX?  I thought that one of the goals of OpenPBX
>  > was to stop doing things like this and relying on external libraries?
> 
> Basically for 2 reasons:
> 1) we need an alternative to take away that crappy config files we are using
> 2) we have to focus on the real meat

So why are you trying to be an XML parsing expert now?  By implementing
your own XML parsing library that's what you need to be now.  XML may
seem simple to parse, but I'm sure that there are some corner cases that
aren't covered properly, there are probably bugs, and you have none of
the features like XInclude, namespaces, and validation that make XML
really useful.

And now that I've looked at the source it seems that you've just taken
the source of ezXML and imported it into the OpenPBX sources.  From what
I see on the ezXML web page (<http://ezxml.sourceforge.net/>) ezXML
can't even check properly for well-formedness.

> While expanding 1) and 2) it turns out that:
> 
> 1) the real meat on that branch is (will be) sofia (ie: using external 
> libraries)

> 2) that simple xml parser works quite well and i can use it in a simple 
> way (so i can focus on the real meat)

> 3) i don't want to spend time to study external XML parsers and 
> validators and implementing it

libxml2 is perfectly capable of loading an XML document without
validating it if you don't want to.  I don't know what you mean by
"implementing it" - you've got to learn the API of any library whether
it's internal or external.

> 4) we have had many problems with portability on platforms != Linux and 
> embedding such a small library is not a bad idea 

Oh please.  libxml2 is likely *more* portable than OpenPBX.  And now the
job of maintaining an XML library just became ours.  Really, I thought
that one of the major goals of the OpenPBX project was to stop embedding
code like this and to use external libraries.

> if compared to the 
> troubles that MANY people who don't even know how to install an external 
> library from sources can arise, even among the people who should be 
> supposed to work with us (And that seems to work agaings us instead)

I'll bet that libxml2 is available as a binary package for 99.9% of the
systems we care about.  If this was really your concern, what about
sofia-sip itself?  Or the dozens of other libraries that we require for
full functionality...

> 5) things like config parsers, memory pools and internal database 
> interaction IMHO are better suited inside of the package.

For me the answer is "it depends".

> So in conclusion:
> 
> If someone writes a working XML config wrapper relying on an external 
> library (_the code complexity would be the same, imho_, because that 
> parser that i included is really simple), writes the docs and tests it 
> on all platform and frees me from doing that instead of concentrating on 
> sofia, that is a good point to do it

This statement makes me wonder how hard you've investigated other XML
libraries.  From what I can see libxml2 isn't that hard to develop with
(see http://xmlsoft.org/examples/tree1.c for one example that compares
favorably with the example on ezXML's web page).

And if you really want to stick with ezXML let's leave it as an external
library rather than importing the source into OpenPBX.

> P.S.: i have added also some functions (=a library??) to manage memory 
> pools because i didn't find any external and suitable alternative.

Which ones did you look at?

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Openpbx-dev mailing list
[email protected]
http://lists.openpbx.org/mailman/listinfo/openpbx-dev

Reply via email to