Can xml can be used as data base?

BlitzMax Forums/BlitzMax Beginners Area/Can xml can be used as data base?

Hardcoal(Posted 2013) [#1]
if so..
where is the blitzmax module?


GfK(Posted 2013) [#2]
The term "database" is very broad. So it all depends what you're trying to achieve.

Brucey's LibXML module should give you enough for most XML-related tasks and you can use it to store data (so it is a database, in a very loose sense of the word), but if you're talking about advanced RDBMS then you need to be looking at some incarnation of SQL, probably MySQL. Think he has a mod for that, too.


xlsior(Posted 2013) [#3]
XML is a basic markup langauge, not a database... It's basically a glorified .ini file.

Depending on how elaborate of a database you need, SQLite is probably much easier to use than MySQL, since it doesn't have any external dependencies.
(and yes, Brucey has a SQLite module as well)


Hardcoal(Posted 2013) [#4]
I need to put information and extract hierarchically.

for example

Player/Power=100
Player/Name="asdsad"

Player/Function/Rotate/Pitch=10
Player/Function/Move/X=10

Im using my own database
but if there is something better for that then i will replace


jsp(Posted 2013) [#5]
I need to put information and extract hierarchically.

That works perfectly using XML


Hardcoal(Posted 2013) [#6]
What about sql? No hirarchy?


jsp(Posted 2013) [#7]
Why not link your database tables in the hierarchy you need.


Kryzon(Posted 2013) [#8]
I need to put information and extract hierarchically.

That works perfectly using XML.


To illustrate: http://msdn.microsoft.com/en-us/library/windows/desktop/ms762271(v=vs.85).aspx


Hardcoal(Posted 2013) [#9]
I have command in my data base called GetsimilarAmout

which means it checks how many times the cell exsists on the same level.

Example:

DataBase
--------

Player/Name/Danny
Player/Name/John

GetSimilarAmount(Player) will return 2

or Example2:

DataBase 2
--------

Player/Name/Danny
Player/Name/Dude
Player/Name/Clare

GetSimilarAmount(Player/Name) will return 3

is such function exsists on XML?


Kryzon(Posted 2013) [#10]
Did you download Brucey's module and taken a look at the API and examples?


Hardcoal(Posted 2013) [#11]
Yea just now :)
Its still not on my todo list. Im just preparing my future steps.
replacing my Database with this one.

Mine works fine but need improvements.
but if XML does the job I wont need to refine mine.

Thanks Guys your very helpful

Kryzon,Gfk,Jsp,xlsior

Now I need to relax going to watch a horror movie.


jsp(Posted 2013) [#12]
Depending on the project I use mainly MaXML which is fast and small (but limited).
It has a built in count for nodes and children.
You could do things like:
For i = 1 To node.ChildCount() to go through the playerlist.


Hardcoal(Posted 2013) [#13]
Whre Can I get module for Maxml ?
is it better then bruceys modulde?


Derron(Posted 2013) [#14]

is it better then bruceys modulde?



In most cases: no.
Maxml may be slightly faster in certain situations (it checks less and therfor is more error-prone eg. it may have problems with character encoding...) but is has less functions/helpers to work with your xml than the wrapped xml library of brucey.


bye
Ron


jsp(Posted 2013) [#15]
As stated above MaXML is limited, but for storing data in a hierarchy it works just fine. It comes with some very convenient functions. It compiles very small as it is written in BlitzMax.
If you could live with the limitation it has, you need to check out.

The XML library Brucey wrapped on the other hand takes care about the whole XML standard, which gives you much more control over XML files if you need those extra functions.
I have used both and decide depending on what I wanna do with the XML. If in doubt and compiled size is no problem go for the libXML.


Duffer(Posted 2013) [#16]
Use SQLite. No dependencies. Brucey created a plugin for that too.... ;)