Add your website to the Xemion web designer directory and gain highly-targeted traffic and new leads.
| Post Reply |
|
|
Thread Tools |
|
#1
October 11, 2005
-
Junior Member,
13 posts
|
|
If you like this tutorial, please register. It encourages me to make more.
If you have any questions about this specific tutorial, just post on the thread. If you have questions about web or graphic design in general, feel free to ask any questions (newb questions or difficult ones!) in the web designer forums. This tutorial is sponsored by the Xemion Web Designer Directory. Welcome to XML 101. The first thing you need to realize, is with all the cool stuff you've probably heard about XML, is that XML essentially does nothing. XML at it's basic form is a practical way of storing information. This may not seem that great, but what it allows for is immensly powerful. This is XMLs ability to communicate between languages. So, SGML was the begining. A meta language, in which you can do whatever you want, make your own anything ect ect. It was very expensive to implement, but extremely powerful. It still is if you have the memory and processing, but the only practical implementation is gigatic servers. Then there was HTML. HTML was a spin off from SGML, but was intended for the display, and presentation of data. HTML, although widely used everywhere is extremely flawed. The presentation layer and the content layer are the same, and confusion is abound. Of the three, XML is the most recent. XML is also a spin off of SMGL, but instead of focusing on the presentation like HTML, XML focuses on describing data, and defining what data is. XML, however, is NOT a replacement for HTML. XML is also a meta language like SGML, where you make your own identifiers and such, but is infinetly more light weight, easy to implement, but not nearly as powerful. But it still does so much! On to the language: First, XML has no tags, you have to invent your own. As the author it's up to you to decide what exactly you name your tags, but keep it organized and to standard, and you will develop good habits early. Example 1 a house: Code:
Code:
The second example is a letter. As you can tell from the tags, it is to "Lowtax" from "New Member of the Lepers Colony." This letter also has a heading, and a body, which clearly seperate them by the defined tags. A key thing to remember is the author names the tags, so it could have been " Ok on to writing your own basic XML document. First, go and buy the MOST expensive compiler you can with XML compatibility. Second, realize that you just wasted all that money because XML is so simple, all you need is notepad for the basic stuff. The only reason you would need a compiler is for multi language things, and even then It's not required. So open up your note pad. ![]() First off, XML has simple but strict regulations when writing code. The first line in the document - the XML declaration - defines the XML version and the character encoding used in the document. ![]() In this case the document conforms to the 1.0 specification of XML and uses the ISO-8859-1 (Latin-1/West European) character set. There are many variations of this and additional information you can add, but this is the most simple and basic set. Now, start a root tag. This is basically what the document will contain information about. In this example, we'll reuse the Lowtax letter. ![]() So you've created a root tag called email. Oh while your at it make sure and create a closing tag because that is very important. To work as an XML file, you need a clear definition of where data starts and where it ends. This is a requirement. ![]() Ok, now to fill the contents, just create tags, and paired closing tags, and then input the text you want! ![]() Simply double check that all tags you've created are closed and save the file as "WHATEVER.XML". You've created a basic XML document, and now you can store your own data with XML! Stay tuned for my next installment, where I show you exactly how adding all these extra tags around your text will help you do things like writing web pages, and adding flash and java to your website. I will also go over more nitpicky details which you should be careful of. Last edited by Xemion : May 27, 2006 at 01:11 PM. |
| Post Reply |
| Thread Tools | |