Qhimm.com Forums

Project forums => Q-Gears => Topic started by: Akari on 2006-08-31 15:10:01

Title: XML library.
Post by: Akari on 2006-08-31 15:10:01
I want implement outer field script and dialog for field module. I need this for testing purpose first. And we may need this for mods in future.

Could someone suggest some good crossplatform XML library?
Title: Re: XML library.
Post by: Micky on 2006-08-31 19:43:42
I'm quite fond of libxml (http://xmlsoft.org/index.html), which I'm using for all kinds of Windows and MacOS/X applications. Alternatively there is Xerces (http://xerces.apache.org/), but I'm not a big fan of its API.
Title: Re: XML library.
Post by: Akari on 2006-09-01 02:49:51
I'm quite fond of libxml (http://xmlsoft.org/index.html), which I'm using for all kinds of Windows and MacOS/X applications. Alternatively there is Xerces (http://xerces.apache.org/), but I'm not a big fan of its API.


Ok.. I thought about libXML2 too  :lol:
Title: Re: XML library.
Post by: Cyberman on 2006-09-03 04:52:15
There appears to be no 'easy' implementation of XML parsers available I've noticed.

I've begun 'doing' the opcodes into an XML type database for clean abuse by other people (cough coiugh)


Current concept thus far is
<opcode id=#XX>
 <name></name>
 <shortdescription></shortdescription>
 <description></description>
 <params count=##>
  <param type="">Name</param>
 </params>
</opcode>
I've done nothing for types as yet. 
Params is obviously a parameter list
name is the given name IE "JMPMAP"
description is a long description
shortdescription is a 1 line description
param is a single parameter's information :D

anything else we should chuck into these?

Do  we want a schema document for describing the opcode etc. so it is checked out for bugs when the XML data is loaded or do we assume it's 'good to go?' I suspect we want to check it for bad coding myself.

For generating our own script code for testing ... what were you thinking of Akari?
Comments (well duh) are needed.
I'm not sure what else :D

Cyb
Title: Re: XML library.
Post by: halkun on 2006-09-03 20:35:45
Just throwing this out there, but what about a TCL parser? (for external scripting)
Title: Re: XML library.
Post by: Cyberman on 2006-09-04 04:09:28
TCL (Tool Command Language) is used for program code.  Although that might be the language Square used. It was popular in the early 90's there are also extensions used for windows et al (Think WISH).  I'll have to look into the structure to see if it's remotely close (LOL).

XML is used for representing data.  You can use the coded data to easily represent a program with comments etc. in it without mixing up the code with the comments and encoded byte stream.  XML does require a parser.  Think HTML without any purpose for the tags other than what you want. I'm looking at DTD documents again (ARGH), I have to remember all that XML 'stuff' I did 2 years ago. My memory stinks too.

I was curious how akari was planing on representing his program test code.

Erstwhile I've been working on a refresher program for XML data coding.

Cyb
Title: Re: XML library.
Post by: mr_sharpoblunto on 2006-09-04 07:37:25
Quote
I'm quite fond of libxml, which I'm using for all kinds of Windows and MacOS/X applications. Alternatively there is Xerces, but I'm not a big fan of its API.

Have a look at Arabica http://www.jezuk.co.uk/cgi-bin/view/arabica Its a very nice API that can wrap around most of the main XML parsers out there (libxml, xerces,expat, MSXML on windows)
Apart from having a nicer API (IMO) using it also means you can switch the implementation of the actual parsing engine without affecting any of your own code.
Title: Re: XML library.
Post by: Cyberman on 2006-09-04 17:37:57
As an addendum Arabica (http://www.jezuk.co.uk/cgi-bin/view/arabica) is an SAX (http://www.saxproject.org/) implementation (Simple Api for XML).
This was originaly ment for Java programs but obviously it has been moved to C++ (see Arabica) etc. :)


Cyb
Title: Re: XML library.
Post by: halkun on 2006-09-04 20:55:57
Take a look at chapter six in the book below.

http://cs.byuh.edu/~andrew/book.pdf

It has a good chapter on TCL script programming. (making external scripts to be parsed by an engine)  Looking at it, it looks *amazingly* like the psudo-code we are generating. It seems almost trivial to hook up a parser and feed it custom commands. With the lack of any other technology that I know of that can parse custom code, other then Bison/Flex, I'm going to say this was most likeliy the scripting language the original fieldscript was written in.

That should make external scripting much easier.