Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

learning about XML 1

Status
Not open for further replies.

ppb7

Programmer
Feb 3, 2005
3
GB
Hello,
now that i've tried to understand how to store data from a web page into a database via server-side scripting languages (ASP, PHP), looking around at job adverts I notice that for a while now XML is as much a required skill as mastery of server-side technology. Why is that? Can XML files contain as large an amount of data as databases? or do they fulfill a different role? And, if so, which is it?
Thanks in advance for answering what are probably very naïve questions,

Philippe
 
XML is most efficient for transfering Smaller data packets rather than a whole data base...

It is a universal format for database transactions, and is web friendly...

If you want to move data from Access to SAP, you would use XML, SAP can't read Access Data, Access can't read SAP, but they can both use XML...

It's similar to:
Text or RTF files for Word Processors
CSV (comma delimited files) for Spreadsheets
DXF files for CAD programs

But it has many other uses than just transfering data...

By itself, XML is just a text file...

The whole idea of XML is the structure the data is represented in.

You can use XML with various other tools, such as XSL (XSLT), DTD, CSS, XPath, XQuery, DOM, SOAP, and many more to do various other things...

One Major use of xml is in Web Page Design
you can define the content of a page with XML, then use XSLT to translate the XML to HTML

You can also submit the data from web forms in xml format.

XML, being a text format, by nature tends to be larger than Binary formats. The trade off is that it can be read without any special tools or parsers, which in itself has many advantages... Corrupted files can be salvaged easier, you can modify a file with any text editor, translators can easily be written.

You can use XML as a stand alone database.
There are many cases where I use it with Visual Basic, via DOM, to have an external set of options, settings, ect...

On the downside, again, XML is a text based format, so larger databases loose there advantage of speed from know binary formats...

I have yet to have a problem with speed, XML+DOM operates much faster than what I need it for, even in cases with thousands of records...

However, if you are a large scale company, and looking for something to handle all of you records, Part Numbers, Costs, Payrole, etc... I would look to something with a binary base, such as Oracle, SAP, etc...

Here are a few sites for further reading:

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
To make a long story short:
I notice that for a while now XML is as much a required skill as mastery of server-side technology. Why is that?
Businesses are using XML to integrate heterogeneous enterprise applications. These might be all in-house applications, or the data exchange can be with external partners.
Can XML files contain as large an amount of data as databases?
XML files can contain an arbitrary amount of data.
or do they fulfill a different role? And, if so, which is it?
For all but small files, a "real" database will perform better as a database. Also, there are practical limits: although you can create an arbitrarily large XML file, you can only use a DOM parser on a file that fits entirely in memory. And a SAX parser, which doesn't keep the entire file in memory, only provides sequential access.
 
Good information! I'm very new to XML, but one thing I've noticed about XML is that it's commonly used as a data transmission format, even if the data is normally stored in a standard database. It has the advantage of being able to store stuctured data in a "flat" format. The data is "serialized" into XML on the sending end, and once recieved it is converted back into it's "stuctured" form.

With the use of technologies such as AJAX (Asynchronous Javascript And XML) you can dynamically query your databases and get responses to display to the user without having to completely reload your web page. That's a trick that just isn't possible with standard web programming models. The web is no longer "stateless"! I'm looking forward to learning more about AJAX and starting to incorporate it into my web projects.



Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Tracy,
As I mentioned above, DOM can be a VERY powerful tool as well...

You can:
Load files into dom with the Load() function
Build and insert xml strings into a DOM object with LoadXML() function
Use Xpath via the SelectNodes() or SelectSingleNode() functions
Modify, Add, & Remove the XML elements and Attributes
Transform an XML document with an XSL document via the transformNode() function
Then save the data to a file with the Save() function
Or get the string representation with the XML() function

One really nice part is that you can use DOM with multiple languages (VB, VBScript, javascript, etc...) in the same way.
Which makes it easy to develop a VB program using XML, then turn around and use the same code to make a web version... Which uses the same Data and code...

I have not yet looked into AJAX, that might have to be my next project ;-)

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Cube: If you know that much about the XML DOM you shouldn't have any trouble at all with AJAX. As far as I can tell it's basically just using the XMLHttpRequest to get an XML document, then using the DOM in Javascript to process it, and using JavaScript with the web page DOM to manipulate what's displayed. Powerful, but not complicated.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top