Think XML for your configuration files!

bridged with qdn.public.qnxrtp.porting
Post Reply
Alain Bonnefoy

Think XML for your configuration files!

Post by Alain Bonnefoy » Mon Oct 28, 2002 4:27 pm

Hi,

I wrote this small library to easily use XML configuration file for any
application.
Why XML, there is many reasons; it's very fashion!, it's very easy to
structure a XML
file independently of the complexity, there is plethora of very good XML
pads (!) to
create, modify these files, it's very easy to use style sheets to
quickly visualize
them on any web browser! etc..., etc..., etc...

So, on the application side, I think about an easy way to declare the
XML file's structure,
and to explain what to do with the read information as well.
This is done by filling a structure table where you specify the tag
name, what sort
of information to find in, numeric, string, etc..., where to put the
information in
your application's data structure, and an optional default value.


I use it in several applications and find it pretty good.
I just like to know if someone is interested and if we have to add
something.

Regards,
Alain.

Kris Warkentin

Re: Think XML for your configuration files!

Post by Kris Warkentin » Mon Oct 28, 2002 6:39 pm

Note also that we ship expat which is a full featured non-validating xml
parser and we also ship the version I wrote (called texpat) which is api
compatable with expat but very small (about 1/4 the size of expat). The
advantage of this is that there are a certain number of apps out there
which use expat already and can use texpat interchangeably.

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 32632 Oct 28 13:27
libxml_magic_parse.so
-rw-r--r-- 1 kewarken None 4744 Oct 28 13:27
libxml_magic_parseS.a

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 25172 Oct 28 13:27 libtexpat.so
-rw-r--r-- 1 kewarken None 19752 Oct 28 13:27 libtexpatS.a

$ ls -l libexpat*
-rw-r--r-- 1 kewarken None 73478 Oct 10 11:13 libexpat.so
-rw-r--r-- 1 kewarken None 88406 Oct 10 11:11 libexpatS.a

The sizes for the libxml_magic_parseS.a seem a little off - the object file
is 7420 bytes....wonder if there's something wrong with my build.

BTW, we also ship a libxml which builds a tree structure to allow you to
load, save, build, edit, search, etc. xml files. It can use expat or texpat
as it's backend. See /usr/include/xmlnode.h.

cheers,

Kris

"Alain Bonnefoy" <alain.bonnefoy@icbt.com> wrote in message
news:3DBD655B.9040807@icbt.com...
Hi,

I wrote this small library to easily use XML configuration file for any
application.
Why XML, there is many reasons; it's very fashion!, it's very easy to
structure a XML
file independently of the complexity, there is plethora of very good XML
pads (!) to
create, modify these files, it's very easy to use style sheets to
quickly visualize
them on any web browser! etc..., etc..., etc...

So, on the application side, I think about an easy way to declare the
XML file's structure,
and to explain what to do with the read information as well.
This is done by filling a structure table where you specify the tag
name, what sort
of information to find in, numeric, string, etc..., where to put the
information in
your application's data structure, and an optional default value.


I use it in several applications and find it pretty good.
I just like to know if someone is interested and if we have to add
something.

Regards,
Alain.

Kris Warkentin

Re: Think XML for your configuration files!

Post by Kris Warkentin » Mon Oct 28, 2002 6:53 pm

Hmm...that will teach me to read the 'readme' first. It would seem that
your library is using texpat and libxml already. So I was preaching to the
choir....That would also explain the size issues - it's dependent on some
external libs.

Well, I'm glad to see that someone is using our stuff anyway. ;-)

cheers,

Kris

"Kris Warkentin" <kewarken@qnx.com> wrote in message
news:apk05b$mpm$1@nntp.qnx.com...
Note also that we ship expat which is a full featured non-validating xml
parser and we also ship the version I wrote (called texpat) which is api
compatable with expat but very small (about 1/4 the size of expat). The
advantage of this is that there are a certain number of apps out there
which use expat already and can use texpat interchangeably.

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 32632 Oct 28 13:27
libxml_magic_parse.so
-rw-r--r-- 1 kewarken None 4744 Oct 28 13:27
libxml_magic_parseS.a

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 25172 Oct 28 13:27 libtexpat.so
-rw-r--r-- 1 kewarken None 19752 Oct 28 13:27 libtexpatS.a

$ ls -l libexpat*
-rw-r--r-- 1 kewarken None 73478 Oct 10 11:13 libexpat.so
-rw-r--r-- 1 kewarken None 88406 Oct 10 11:11 libexpatS.a

The sizes for the libxml_magic_parseS.a seem a little off - the object
file
is 7420 bytes....wonder if there's something wrong with my build.

BTW, we also ship a libxml which builds a tree structure to allow you to
load, save, build, edit, search, etc. xml files. It can use expat or
texpat
as it's backend. See /usr/include/xmlnode.h.

cheers,

Kris

"Alain Bonnefoy" <alain.bonnefoy@icbt.com> wrote in message
news:3DBD655B.9040807@icbt.com...
Hi,

I wrote this small library to easily use XML configuration file for any
application.
Why XML, there is many reasons; it's very fashion!, it's very easy to
structure a XML
file independently of the complexity, there is plethora of very good XML
pads (!) to
create, modify these files, it's very easy to use style sheets to
quickly visualize
them on any web browser! etc..., etc..., etc...

So, on the application side, I think about an easy way to declare the
XML file's structure,
and to explain what to do with the read information as well.
This is done by filling a structure table where you specify the tag
name, what sort
of information to find in, numeric, string, etc..., where to put the
information in
your application's data structure, and an optional default value.


I use it in several applications and find it pretty good.
I just like to know if someone is interested and if we have to add
something.

Regards,
Alain.



Jens H Jorgensen

Re: Think XML for your configuration files!

Post by Jens H Jorgensen » Mon Oct 28, 2002 7:47 pm

Hi Kris

Where would I find documentation on libxml and texpat API's?

Thanks
Jens

"Kris Warkentin" <kewarken@qnx.com> wrote in message
news:apk0v5$no4$1@nntp.qnx.com...
Hmm...that will teach me to read the 'readme' first. It would seem that
your library is using texpat and libxml already. So I was preaching to
the
choir....That would also explain the size issues - it's dependent on some
external libs.

Well, I'm glad to see that someone is using our stuff anyway. ;-)

cheers,

Kris

"Kris Warkentin" <kewarken@qnx.com> wrote in message
news:apk05b$mpm$1@nntp.qnx.com...
Note also that we ship expat which is a full featured non-validating xml
parser and we also ship the version I wrote (called texpat) which is api
compatable with expat but very small (about 1/4 the size of expat). The
advantage of this is that there are a certain number of apps out there
which use expat already and can use texpat interchangeably.

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 32632 Oct 28 13:27
libxml_magic_parse.so
-rw-r--r-- 1 kewarken None 4744 Oct 28 13:27
libxml_magic_parseS.a

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 25172 Oct 28 13:27 libtexpat.so
-rw-r--r-- 1 kewarken None 19752 Oct 28 13:27 libtexpatS.a

$ ls -l libexpat*
-rw-r--r-- 1 kewarken None 73478 Oct 10 11:13 libexpat.so
-rw-r--r-- 1 kewarken None 88406 Oct 10 11:11 libexpatS.a

The sizes for the libxml_magic_parseS.a seem a little off - the object
file
is 7420 bytes....wonder if there's something wrong with my build.

BTW, we also ship a libxml which builds a tree structure to allow you to
load, save, build, edit, search, etc. xml files. It can use expat or
texpat
as it's backend. See /usr/include/xmlnode.h.

cheers,

Kris

"Alain Bonnefoy" <alain.bonnefoy@icbt.com> wrote in message
news:3DBD655B.9040807@icbt.com...
Hi,

I wrote this small library to easily use XML configuration file for
any
application.
Why XML, there is many reasons; it's very fashion!, it's very easy to
structure a XML
file independently of the complexity, there is plethora of very good
XML
pads (!) to
create, modify these files, it's very easy to use style sheets to
quickly visualize
them on any web browser! etc..., etc..., etc...

So, on the application side, I think about an easy way to declare the
XML file's structure,
and to explain what to do with the read information as well.
This is done by filling a structure table where you specify the tag
name, what sort
of information to find in, numeric, string, etc..., where to put the
information in
your application's data structure, and an optional default value.


I use it in several applications and find it pretty good.
I just like to know if someone is interested and if we have to add
something.

Regards,
Alain.





Kris Warkentin

Re: Think XML for your configuration files!

Post by Kris Warkentin » Mon Oct 28, 2002 9:56 pm

The libxml is quite heavily documented in its header file
/usr/include/xmlnode.h. Texpat is also fairly well documented in its header
/usr/include/texpat/xmlparse.h but you could go look at the expat
documentation as well to get an idea of how it works.

http://www.jclark.com/xml/expat.html

You basically just register handlers for various xml tags and they are
called as the file is parsed.

cheers,

Kris

"Jens H Jorgensen" <jhj@remove-nospam-videk.com> wrote in message
news:apk3u8$t66$1@inn.qnx.com...
Hi Kris

Where would I find documentation on libxml and texpat API's?

Thanks
Jens

"Kris Warkentin" <kewarken@qnx.com> wrote in message
news:apk0v5$no4$1@nntp.qnx.com...
Hmm...that will teach me to read the 'readme' first. It would seem that
your library is using texpat and libxml already. So I was preaching to
the
choir....That would also explain the size issues - it's dependent on
some
external libs.

Well, I'm glad to see that someone is using our stuff anyway. ;-)

cheers,

Kris

"Kris Warkentin" <kewarken@qnx.com> wrote in message
news:apk05b$mpm$1@nntp.qnx.com...
Note also that we ship expat which is a full featured non-validating
xml
parser and we also ship the version I wrote (called texpat) which is
api
compatable with expat but very small (about 1/4 the size of expat).
The
advantage of this is that there are a certain number of apps out
there
which use expat already and can use texpat interchangeably.

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 32632 Oct 28 13:27
libxml_magic_parse.so
-rw-r--r-- 1 kewarken None 4744 Oct 28 13:27
libxml_magic_parseS.a

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 25172 Oct 28 13:27 libtexpat.so
-rw-r--r-- 1 kewarken None 19752 Oct 28 13:27 libtexpatS.a

$ ls -l libexpat*
-rw-r--r-- 1 kewarken None 73478 Oct 10 11:13 libexpat.so
-rw-r--r-- 1 kewarken None 88406 Oct 10 11:11 libexpatS.a

The sizes for the libxml_magic_parseS.a seem a little off - the object
file
is 7420 bytes....wonder if there's something wrong with my build.

BTW, we also ship a libxml which builds a tree structure to allow you
to
load, save, build, edit, search, etc. xml files. It can use expat or
texpat
as it's backend. See /usr/include/xmlnode.h.

cheers,

Kris

"Alain Bonnefoy" <alain.bonnefoy@icbt.com> wrote in message
news:3DBD655B.9040807@icbt.com...
Hi,

I wrote this small library to easily use XML configuration file for
any
application.
Why XML, there is many reasons; it's very fashion!, it's very easy
to
structure a XML
file independently of the complexity, there is plethora of very good
XML
pads (!) to
create, modify these files, it's very easy to use style sheets to
quickly visualize
them on any web browser! etc..., etc..., etc...

So, on the application side, I think about an easy way to declare
the
XML file's structure,
and to explain what to do with the read information as well.
This is done by filling a structure table where you specify the tag
name, what sort
of information to find in, numeric, string, etc..., where to put the
information in
your application's data structure, and an optional default value.


I use it in several applications and find it pretty good.
I just like to know if someone is interested and if we have to add
something.

Regards,
Alain.







Alain Bonnefoy

Re: Think XML for your configuration files!

Post by Alain Bonnefoy » Tue Oct 29, 2002 6:26 am

Hey Kris, would you think that you work for nothing !?!
Cheers
Alain.

Kris Warkentin a écrit:
Hmm...that will teach me to read the 'readme' first. It would seem that
your library is using texpat and libxml already. So I was preaching to the
choir....That would also explain the size issues - it's dependent on some
external libs.

Well, I'm glad to see that someone is using our stuff anyway. ;-)

cheers,

Kris

"Kris Warkentin" <kewarken@qnx.com> wrote in message
news:apk05b$mpm$1@nntp.qnx.com...


Note also that we ship expat which is a full featured non-validating xml
parser and we also ship the version I wrote (called texpat) which is api
compatable with expat but very small (about 1/4 the size of expat). The
advantage of this is that there are a certain number of apps out there
which use expat already and can use texpat interchangeably.

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 32632 Oct 28 13:27
libxml_magic_parse.so
-rw-r--r-- 1 kewarken None 4744 Oct 28 13:27
libxml_magic_parseS.a

$ ls -l *.a *.so
-rw-r--r-- 1 kewarken None 25172 Oct 28 13:27 libtexpat.so
-rw-r--r-- 1 kewarken None 19752 Oct 28 13:27 libtexpatS.a

$ ls -l libexpat*
-rw-r--r-- 1 kewarken None 73478 Oct 10 11:13 libexpat.so
-rw-r--r-- 1 kewarken None 88406 Oct 10 11:11 libexpatS.a

The sizes for the libxml_magic_parseS.a seem a little off - the object


file


is 7420 bytes....wonder if there's something wrong with my build.

BTW, we also ship a libxml which builds a tree structure to allow you to
load, save, build, edit, search, etc. xml files. It can use expat or


texpat


as it's backend. See /usr/include/xmlnode.h.

cheers,

Kris

"Alain Bonnefoy" <alain.bonnefoy@icbt.com> wrote in message
news:3DBD655B.9040807@icbt.com...


Hi,

I wrote this small library to easily use XML configuration file for any
application.
Why XML, there is many reasons; it's very fashion!, it's very easy to
structure a XML
file independently of the complexity, there is plethora of very good XML
pads (!) to
create, modify these files, it's very easy to use style sheets to
quickly visualize
them on any web browser! etc..., etc..., etc...

So, on the application side, I think about an easy way to declare the
XML file's structure,
and to explain what to do with the read information as well.
This is done by filling a structure table where you specify the tag
name, what sort
of information to find in, numeric, string, etc..., where to put the
information in
your application's data structure, and an optional default value.


I use it in several applications and find it pretty good.
I just like to know if someone is interested and if we have to add
something.

Regards,
Alain.









Post Reply

Return to “qdn.public.qnxrtp.porting”