Page 1 of 1

XML... ??

Posted: Mon Jan 16, 2006 2:06 pm
by Luke
OK, I just read the ENTIRE xml tutorial on W3Schools for the second or third time and I still don't understand what the hell it is for...
I can see how it would be an awesome replacement for html, but it says that's not what it is... It seems like a cool way to store information, but databases kinda already serve that purpose... what is it for??

Posted: Mon Jan 16, 2006 2:09 pm
by foobar
Config files, news feeds, and storing small amounts of (hierarchical) data.
Bonus: it looks cool and it's trendy. :wink:

Posted: Mon Jan 16, 2006 2:20 pm
by timvw
XML is simply a hierarchical structure with one rootnode and eventually childnodes (which can have childsnodes and so on..) in textformat. Offcourse there are also a couple of rules defined how to represent data in the nodes and attribute values.

XHTML is a form of XML, but there are rules that restrict the document so that only a specific order of nodes and attributes is possible (eg: rootnode must be html and must only contain one head and one body).

So now you may wonder: how can i define my own rules/restrictions to a document? That is done via a DTD/XSD document.

And the XML way of changing the original XML document in a format (another xml document, binary, plaintext) that is more suitable for your use is by writing an XSL document that does the Transformation. (To specify the parts of an XML document you want to use you have to use XPATH).

If i'm not mistaken, there are tutorials for all these technologies on w3schools.

Apparently people seem to use it very often for configuration files (instead of plain-text, csv, ini, ...) or for web-oriented applications (wsdl, soap, ... ) backed by companies like SAP and Peoplesoft. It is also widely used for dynamic webpages (JSP, WACT_Template, ...). Database vendors like Oracle and Microsoft are currently offering the posiblity to fetch SQL resultsets in an XML document... Simply put: if you're thinking about becoming a programmer, you will have to become familiar with it ;) (Just as you need to know SQL)

Posted: Mon Jan 16, 2006 3:56 pm
by Luke
foobar wrote:Config files, news feeds, and storing small amounts of (hierarchical) data.
Bonus: it looks cool and it's trendy. :wink:
Man there's nothing I hate more than things that are "trendy"
timvw wrote:XHTML is a form of XML, but there are rules that restrict the document so that only a specific order of nodes and attributes is possible (eg: rootnode must be html and must only contain one head and one body).
I thought HTML was a form of SGML...

How can HTML be a form of XML if XML came after it?

Posted: Mon Jan 16, 2006 3:58 pm
by Roja
The Ninja Space Goat wrote:
timvw wrote:XHTML is a form of XML, but there are rules that restrict the document so that only a specific order of nodes and attributes is possible (eg: rootnode must be html and must only contain one head and one body).
I thought HTML was a form of SGML...

How can HTML be a form of XML if XML came after it?
You missed the X, re-read what he said. XHTML is a form of XML - not HTML.

Posted: Mon Jan 16, 2006 4:15 pm
by Luke
Roja wrote:
The Ninja Space Goat wrote:
timvw wrote:XHTML is a form of XML, but there are rules that restrict the document so that only a specific order of nodes and attributes is possible (eg: rootnode must be html and must only contain one head and one body).
I thought HTML was a form of SGML...

How can HTML be a form of XML if XML came after it?
You missed the X, re-read what he said. XHTML is a form of XML - not HTML.
OH... thank you. I was confused for a moment there.

EDIT: I went back and began reading the DTD tutorial and now I am beginning to understand the coolness of XML.