XML Module

BlitzMax Forums/BlitzMax Module Tweaks/XML Module

N(Posted 2004) [#1]
If this is how people are going to act, then do it yourself.


Bot Builder(Posted 2005) [#2]
Thanks noel


Murilo(Posted 2005) [#3]
Nice one. I was about to embark on writing one of these myself. I won't bother now...


Murilo(Posted 2005) [#4]
I'm trying to build this XML mod. However, when I try to build the module(s) from within the official IDE, I get the following error:

Building Modules
Compiling:blitz_app.c
'gcc' is not recognized as an internal or external command,
operable program or batch file.
Build Error: failed to compile C:/BlitzMax/mod/brl.mod/blitz.mod/blitz_app.c
Process complete
Anyone else getting this or know how to fix it?


Murilo(Posted 2005) [#5]
[ahem] It looks like I need to install mingw32.


Murilo(Posted 2005) [#6]
Hmmm... I've installed MinGW to C:\MinGW\ and added C:\MinGW\Bin\ to my path, but GCC still won't work! Am I missing a step or something?

[Edit]Sorted - Had a rogue quote in my path somehow! Your XML.mod is working great so far.[/Edit]


Bot Builder(Posted 2005) [#7]
The code doesnt check for XML entities like ' or <. here are the fixed functions: I also fixed a bug that makes it so the writenode function didnt add in node values, only attributes:



TommyBear(Posted 2005) [#8]
Nice.


Rob Pearmain(Posted 2005) [#9]
Now when build anything I get the following, I get this error:
Compiling:digesteroids.bmx
flat assembler  version 1.51
43 passes, 0.1 seconds, 170454 bytes.
Linking:digesteroids.exe
[ERROR]: e:\blitzmax\bin\ld: cannot find e:/blitzmax/mod/cower.mod/xml.mod/xml.d.a
[ERROR]: Build Error: Failed to link e:/blitzmax/samples/digesteroids/digesteroids.exe


How do I get the xml.d.a file, sorry new to blitzmax


N(Posted 2005) [#10]
You compile it. Read the documentation (the barely passable one that comes with BlitzMax) to figure out how to compile modules.


Bot Builder(Posted 2005) [#11]
The module compiling this is pretty rediculous. Calling bmk makemods only creates one set of files when you need both if you want to be able to use debug alternatly with release. Basically, whenever you use makemods now duplicate the call and add a -r.


N(Posted 2005) [#12]
I think -a should compile both release and debug, but at the moment I can't even figure out if -a does anything useful.


Mirko(Posted 2005) [#13]
Tried to compile it but allways get the following error:

Compiling:xml.bmx
Compile Error: Subexpression for release must be an integer variable
[C:/BlitzMax/mod/cower.mod/xml.mod/xml.bmx;68;3]
Build Error: failed to compile

It's the XMLDeleteNode function.
What am i doing wrong ?


N(Posted 2005) [#14]
It's old code, you have to remove all useage of 'Release'.


Drago(Posted 2005) [#15]
-a means to rebuild all files


N(Posted 2005) [#16]
Like I said: old code.

In fact, here's the new code (not based off of Blitztastic's):
EDIT: If this is how people are going to act, then do it yourself.


Mirko(Posted 2005) [#17]
Hi, your new code uses

Import Cower.CUtil

where will i get that library from?


N(Posted 2005) [#18]
You can probably guess where to put it. If not, it goes under 'mod/cower.mod/cutil.mod/cutil.bmx'

EDIT:If this is how people are going to act, then do it yourself.


Mirko(Posted 2005) [#19]
Hi Noel,

thanx for the fast response. Now both of the components can be compiled without any further problems.

I don't want to bother you too much, but could you tell me, what is the best way to read out the value for a path like
'xx/yy/zz'
<xx>
 <ff>
  <fa>test 0</fa>
 </ff>
 <yy>
  <zz>test</zz>
  <aa>test2</aa>
 </yy>
</xx>

With the old component, which i fixed to work on my system, i used findnode to figure out the needed value. But how will i do this task with this new component?


N(Posted 2005) [#20]
Use a recursive function that finds a specific element name.

DIY is the BlitzBasic motto, so you'll have fun.


Michael Reitzenstein(Posted 2005) [#21]
Noel, why do you do stuff like:

Function cContaini(a:Int Ptr, b:Int, c:Int)
	a[0]=Min(Max(a[0],b),c)
End Function


Instead of

Function cContaini( a:Int Var, b:Int, c:Int )

      a = Min( Max( a, b ), c )

End Function
?


N(Posted 2005) [#22]
Why does it matter?


Michael Reitzenstein(Posted 2005) [#23]
Because then you can do this:

cContaini( a, b, c )

Instead of:

cContaini( Varptr( a ), b, c )

Plus the function looks neater.


N(Posted 2005) [#24]
Haven't sold me on it yet.


Michael Reitzenstein(Posted 2005) [#25]
Not for this specific function, but if you use pointers all the time when they're unnecessary you could run into subtle little problems like you did with OpenGL drawing text. Your choice.


N(Posted 2005) [#26]
you could run into subtle little problems like you did with OpenGL drawing text.


That was more of a problem with BRL not exposing functions that could have resolved the problem easily.


Michael Reitzenstein(Posted 2005) [#27]
Yeah, and you'll be blaming your next problem on the way computers handle pointers.


teamonkey(Posted 2005) [#28]
In this case it's true. glMax2D is locked down so that if you use Max2D functions you can't use useful OpenGL stuff (like textures, for example). Exposing a few functions (EnableTex() and DisableTex() for example) would make life so much easier for third party mod developers. As it is it's pretty much impossible to make OpenGL-based mods that work with Max2D without also having to distribute a tweaked glMax2D module with it (and the support issues that would create).


Proger(Posted 2005) [#29]
Where possible download module??


N(Posted 2005) [#30]
Nowhere.


Jay Kyburz(Posted 2005) [#31]
Whats up Noel? Did i miss something?


N(Posted 2005) [#32]
I'd have offered to send it to him, but he's Russian.


TommyBear(Posted 2005) [#33]
If this is how you are going to act Noel, don't post modules. If you can't stand peer review, don't waste the time of other people, who need to download, install and test your stuff.

how sad.


Proger(Posted 2005) [#34]
>but he's Russian.
hm...And that?
I not russian, but from Russia ;)


N(Posted 2005) [#35]
TommyBear: I've had this discussion before, and it has nothing to do with peer review. I can handle that just fine.

Secondly, I never asked anyone to download, install, and test my work, nor does anyone need to. I provided this work free of charge to people and what does someone do but come along and insult me.

Unless I get an apology from Mike, this code is going to be unavailable. So you all can thank Michael Reitzenstein for his wonderful efforts on making everyone else unhappy.