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!

Question about XML (quick one)

Status
Not open for further replies.

mike314

Programmer
Jun 24, 2003
143
US
Ok so I've bought an XML book and I've been reading how to define data and creat my own tags. But what exactly can you do with these tags and data??? I mean how can you use HTML and XML together????

It seems to me that XML is basically a low budget database where you keep data but where can you view this data and what can you do with an .xml file???


thanks any help is much appreciated
 
This question has been asked before, please do a search in the forum.

But basically, XML is a (mostly) self-documenting data format that is typically used to share data across disparate systems.

HTML is a sub-set of XML (more properly, XHTML is a subset of XML, the original HTML spec had a number of problems).

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
XML is also more object based where most DBs are record based...

Where records are based on tables...
XML has more of a tree structure that can branch and include sub nodes...

XML by itself is just a text file similar to an html file...

What gives it it's power is the tools you use it with...

You can use DOM with programming languages to access the Object Model of the file where you can Read, Write, and modify any element in an XML file...

You can use XSL to transform an XML file into a different format, including Text files, HTML files, and other XML files...

XPath lets you access the elements as if they were directories on a computer... Which is supported by DOM and XSL...

There are several other tools you can use such as SOAP, XQuery, etc...
Or you can make your own parser, since it is just text...

Which raises another good point... XML is a TEXT format... so if anything happens to it, you can recover most of the data, where corrupt binary files can be seemingly imposible to recover...

In short...
Q:> So why would you want to use XML instead of just using a plain text file?

A:> Because it is simple, standardized, and has free and readily available tools to work with the data...

Note: XML is not a replacement for Data Bases...
It can be used to transfer data between DataBases, and can even be used for small databases, if you just need a quick solution...
But for large DBs, speed can be an issue for XML once it gets past a certain size, which varies depending on your system... Where databases are optimized to handle large tables...

I am still somewhat new to XML, but it is super easy to learn once you get the hang of it...

Your first comment reminds me of myself when I first heard of it...

I went out and bought a book or 2, then thought: "Why would I want to use this???"
3 or 4 books later (and with the help of W3 Schools) I actually sat down and started to learn what all you can use it for... and the possibilities are ever growing...

I use XML with VB (via DOM) to create on the fly objects which can be manipulated and saved for loading at a later time, all with ease...

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
ok thanks got another quick one here

Using DTD's do you need a validator to validate the DTD used in my XML files????

thanks
 
DTDs are pretty old -- if you can, switch to the new XSD technology.

But in general, both of them are used to validate the structure of an XML document. When designing a new data interchange, start with the DTD/XSD, then use a tool like XMLSpy to generate sample XML files that you can test with.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top