XML Explaination

I just started working for this company. They want me to work on an XML project where Tamino is included. I have to create a front end that accesses and searches through an XML database. I don’t know the quary set-ups, but mainly I don’t understand how a normal file transforms into a database… How does all this work? Can someone take a few minutes to explain XML and the database and why someone doesn’t just quary from an XML file? Any rambling will help me, please. Thanks

blair

Hi Blair,

I am probably not the best person to persuade you of the benefits of using a database, but I will try and give some pointers.

When asking “why use an XML database?” it might be helpful to ask “why use a database?”.
Databases offer several advantages over plain filesystem access, such as: transactionality, access isolation levels, simplified backup/restore, scalabilty, standardized query languages, APIs and so forth.

Tamino offers these features (and more!) for XML documents.
So, whereas with a filesystem based approach you would need to implement code to validate documents against a DTD/Schema, query documents, prevent simultaneous updates, etc.; if you store your documents in Tamino you can use its existing functionality to do all these things.

Where Tamino particularly stands out from using an RDBMS to store XML documents is the area of query and retrieval.
As Tamino is storing the documents “natively” (rather than storing the whole file in a big VARCHAR or “shredding” it into multiple VARCHARs), it is much faster for querying and retrieving the matching documents.
Why? Well, if a whole document is stored in a VARCHAR (or a flat file, for that matter) the whole file needs to be processed in order to evaluate whether it meets the query criteria or not. (Whereas Tamino preserves the structure, so it can map the query directly to the element within the document, rather than processing the whole document.)

This drawback with an RDBMS solution can be somewhat circumvented by decomposing the XML document into multiple columns (this is commonly known as “shredding”), but whilst this might speed the queries it requires that the documents be re-assembled (“un-shredded”?) before they are returned. Meaning: extra processing cycles.

This approach also requires that the developer do some amount of work to handle the composition/decomposition of the XML documents, which means: if the document structure changes, the code needs to change too.

If you need to retrieve a fragment of a document (i.e. a sub-tree), this is easy to do in Tamino - but not so easy with a home-grown solution.

These are the few ideas which immediately spring to mind. I’m sure you can find more - probably even more convincing - information in the Tamino literature.

Cheers,
Trevor.

Beside this very good general explanation from Trevor, you might also want to browse thru the online documentation of Tamino. It will give you also a good deal of general information about XML and the database.

In which technology do you need to develop? Visual Basic and the ActiveX API or something else?

Only besause I know a lot of ASP am I choosing to try to use it.

Okay, now that I have an idea of Tamino and XML too, since I just read a lot of a reference book last night, I gotta figure out how to use ASP to Query…since that IS what I have to do. I found some examples and such which I’ll go through into more detail. OHH, I remember what I wanted to ask: Can I run an XML file off my computer: Using XP…? Or even a computer with 2000 Server or something? Do you NEED a Tamino type server to run queries? I am asking this because I’d like to test my code on my workstation and play with it until I get something I’d like to test on a Tamino server. To sum up, I’d like to run queries on a normal XML file AND a Tamino server via an ASP page… Or anything simple. I’d learn “Tamino’s” version of the query, but since my compnay may not want to use Tamino because of the cost after the trial, I’d liketo use something generic and learn on that. Which is why I am choosing ASP.

Thanks a lot guys for the explaination, hopefully you can help me more! :slight_smile:

BTW: I’m here all day, so if you post something, most likely I’ll get it and respond within 5 minutes.

Sorry, another thing…haha

Is there any way I can do a query much like how ASP query’s an Access DB? It gets the result as a variable and the programmer can do whatever he wants with it. I know you have to use style sheets for XML, but can I query, snag the result as a variable, and display it in terms of an ASP variable…

i.e.

query a “Person” tag where the person’s name = “blair” or something…then get that value and write a while loop or something to display

while not eof

response.write person 'var person = the result

wend

  1. Can I run an XML file off my computer …?
    You probably can do that. However, as the queries most probably will be done using XPath, you will need to have an XPath engine working on your file system. It might be easier to install a Tamino server for testing on your workstation (if you want to be independent of “the” Tamino server).

    2. What about the result …?
    It is the usual way of programming against an XML database to get the document back in its XML form (usually a DOM tree) and there is no stylesheet involved. You may walk thru this tree with while loops to get the elemnts and attributes. If your query returns more then one document, you may iterate over them in a while loop as well.

    3. Did you have a look at the JScript API. Maybe this fits your approach in a better way?