![]() |
|
| • All Online Courses • New Courses • QuickTips • Word Definitions • Submit a Tutorial • Links • |
|
Learn XML programming in this free XML training course Section 2: XML SyntaxAlright, I want to use XML. What do I do first?The first thing that you’ll need to do is open up your text editor of choice. Place your XML directive on the first line, as mentioned earlier. At this point, your document is going to look something like this (if you’re using XML version 1.0): <?xml version=”1.0”?> Once you’ve typed your directive, it’s time to start adding some content to the page. Information on an XML page is handled in a very precise and structured format, using tags to define your data. White space can be included in the document, to make it more easily readable… though you should be careful not to use that white space inside of your tags, as it can create problems when being read by a browser. Let’s say that you’ve decided to create a new XML document, to tell the world about your two favorite cats. You want to use the tag, <cats>, and let everyone know how much you love those little furballs. Your document now looks a little something like this… <?xml version=”1.0”?> <cats>Tooter and Shade are the best cats in the world!</cats> Note the white space in between the directive and the first tags. You could also have put both of the tags on their own line, with the content of the tags between them, as long as you don’t add additional white space within the tags. Of course, for the moment the <cats> tags don’t do anything. If you load this page into a web browser, you’ll end up with more or less a copy of the file contents displayed on the screen with the tags in some pretty colors. You’ll have to define the tags, which can be done in 1 of 4 ways:
All of this might sound complicated, but it’s really not. It does involve creating and referencing other pages, though… and for now we’re still working on just the basic structure of XML. Save your document (in Text-Only mode) under the name cats.xml (making sure to use the .xml extension) and we’ll get back to the <cats> tags in a moment.
by John Casteele Find more free Internet tutorials from Learnthat.com. More Information:
Help us by rating this tutorial: [---] [--] [+] [++] [+++] [---] lowest; [+++] highest
|
|
||||||
![]() |
Learn: Free
Tutorials - Links
to Free Tutorials
Understand: Free Technical Definitions
- ExplainThat Whitepapers
Use: Certification Section -
Discussion Forum
Visit Our Network Sites:
About Us : Contact Us : Advertise : Privacy Information