Web Templates
Web Templates  
Photoshop Layouts  
Flash Templates  
Templates Resource - Web Templates
   
 
  Sign UpPassword
Templates Resource Services Support Specials Members View Cart
 
  Photoshop Tutorials
  HTML Tutorials
  ASP Tutorials
  CSS Tutorials
  Javascript Tutorials
  PHP Tutorials
  XML Tutorials
  Flash Tutorials
  Fireworks Tutorials
  3D Studio Max Tutorials
  Cinema 4d Tutorials
  Graphics
  Website Tools
  Web Templates
  About Templates Resource
  Affiliates Program
  TR Support
  Webmaster Resources
 Columbia Tech Support

WebDesignHelper.co.uk


 

XML Tutorials

XML Rules

Beginner

 

Learn the simple rules of XML.

Defining an XML File
XML is a very easy language to use and maintain. There are just a few steps to follow to successfully make an XML file. The first thing to do is do define the document as an XML file. An XML file doesn't have to end in a .xml entension, all it needs is the first line to be:

<?xml version="1.0" encoding="utf-8"?>

Closing and Opening Tags
It is safe to say that that the line above is the only thing in XML that doesn't need a closing tag. Unlike HTML, every tag you make in the XML file needs an open and closing tag. You can make up any type of a name for the type, as long as you open and close it. This includes any tag you might want to make for images, links, etc. For instance, in the following code, see how the spoono tag is opened and closed?:

<spoono>Hi</spoono>

Tags are Case Sensitive
Unlike HTML, XML tags are case-sensitive and defining one doesn't mean the same as the other. For instance, this would give you an error:

<Spoono>Hi</spoono>

Nesting
Every tag must be inside the root element tag which must encompass all the other sub-elements. This pretty much means that in our script, all the coding we do must be inside the <spoono></spoono> and you can't have multiple instance of the spoono tag. Everything must be nested inside this immense spoono tag. Also, tags must be closed in the reciprocating order as they are open. For example:

<spoono>
<title><b>Spoono Rocks</b></title>
<news>I'm writing a tutorial</news>
</spoono>

Attributes
In any given tag, you're allowed to have as many attributes as you want. To give an example of an attribute, the "href" in the "a" tag of an HTML link is an attribute. So is the "src" in an "image" tag, etc. All the attribute values inside the tag must be in quotes. For example:

<spoono>
<title type="post"><b>Spoono Rocks</b></title>
<news author="Akash Goel" date="9/1/03">I'm writing a tutorial!</news>
</spoono>

Conclusion
As you can see, there aren't too many rules to follow for writing XML code. It is really the parser for XML which has to do the grunt work by reading the XML file and making it look useable to a viewer. If you have any questions, feel free to post on the discussion board by clicking the link below and someone will be sure to help.

 

This tutorial is provided to you by Spoono

More Tutorials
 

XML Tutorials

Commenting and CDATA
This article will teach you about commenting and learning how to write text which you want to go unparsed in XML.

Beginner

Intro to XML
This article will give a brief introduction to XML.

Beginner

RSS - Really Simple Syndication
RSS, or Really Simple Syndication is an XML-based format that allows links, news posts, and other lists to be displayed in an organized manner.

Intermediate

XML Rules
Learn the simple rules of XML.

Beginner

XML Stylesheets
This article will introduce you to the XSL stylesheet language and how it can be used to display XML as HTML in a browser.

Intermediate

More Tutorials

Web Template Preview 92307001

Web Templates ID:

92307001

User Level:

Advanced web template


Web Template Preview 92308001

Web Templates ID:

92308001

User Level:

Advanced web template


Web Template Preview 92308201

Web Templates ID:

92308201

User Level:

Advanced web template


Web Template Preview 92308101

Web Templates ID:

92308101

User Level:

Advanced web template


Templates Resource FAQ Terms of Use Site Map Link To Us

© Copyright 2003-2008 Templates Resource