[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
BeginnersGuideToXML
An example of a basic XML structure follows:
This structure represents the organization of a company called the XYZ Corporation. It has two offices, the Sales Office and the Personnel Office, which have 2 and 1 employees respectively.
XML allows you to take vastly complicated structures and break them down into their elements in a consistent format which will then be readable and editable by any XML client.
However, XML and HTML serve different purposes. HTML is more concerned with how information is ''presented'', for example, in a browser. XML, on the other hand, does not by itself deal with presentation; it is concerned with how data is ''structured''.
However, this extensibility has a consequence: there are no built-in checks as to the consistency of your information. You could, for example, have one customer tagged as <customer> and another tagged as <client>, a situation which could get messy very quickly.
Fortunately, XML provides a way of enforcing order on the extensibility. This is done through the use of Document Type Definitions (DTDs) which provide the framework in which you will create the rest of your XML document.
While any XML document may be ?well-formed, that is, the tags all work and properly nest the information, only an XML document which is consistent with a DTD can be said to be ?valid.
Many ?database managers are already capable of translating XML information, and this will become more common as the importance of XML increases. Furthermore, XML boasts a sister language which interfaces nicely with XML in order to provide formatted output. This sister language is called the E'''x'''tensible '''S'''tylesheet '''L'''anguage, or ?XSL.
With the many tools provided by XSL, you can now take huge amounts of XML information and present it in almost any imaginable format, up to and including HTML itself.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
BeginnersGuideToXML
XML (Extensible Markup Language)
The E'''x'''tensible '''M'''arkup '''L'''anugage, or XML, is, in its simplest form, a language which allows you to store information in a structured and accessible format. XML works through the use of tags to define the role of information within a system.An example of a basic XML structure follows:
<company>
<name>The XYX Corp</name>
<office>
<name>Sales Office</name>
<empolyee>
<name>Joe Smith</name>
<title>Chief Sales Executive</title>
</employee>
<employee>
<name>Ralph Mondragon</name>
<title>Sales Executive</title>
</employee>
</office>
<office>
<name>Personnel Office</name>
<employee>
<name>Regina Rubenstein</name>
<title>Human Resources</title>
</employee>
</office>
</company>
This structure represents the organization of a company called the XYZ Corporation. It has two offices, the Sales Office and the Personnel Office, which have 2 and 1 employees respectively.
XML allows you to take vastly complicated structures and break them down into their elements in a consistent format which will then be readable and editable by any XML client.
XML and HTML
Readers already experienced with HTML may note that the tags used follow a very similar format: an opening tag <tagname> followed by information and then the closing tag </tagname>. The reason for the similarity is that both XML and HTML are SGML applications: that is, they are both designed according to a type of document structure called ?SGML.However, XML and HTML serve different purposes. HTML is more concerned with how information is ''presented'', for example, in a browser. XML, on the other hand, does not by itself deal with presentation; it is concerned with how data is ''structured''.
Valid XML
XML is first and foremost '''extensible'''. This means that, unlike HTML, the tags are not predefined. You can create your tags however you wish, giving them descriptive names such as <customer> or <product>. In this way, you can store your information in a format instantly readable, analyzable, and editable by anyone.However, this extensibility has a consequence: there are no built-in checks as to the consistency of your information. You could, for example, have one customer tagged as <customer> and another tagged as <client>, a situation which could get messy very quickly.
Fortunately, XML provides a way of enforcing order on the extensibility. This is done through the use of Document Type Definitions (DTDs) which provide the framework in which you will create the rest of your XML document.
While any XML document may be ?well-formed, that is, the tags all work and properly nest the information, only an XML document which is consistent with a DTD can be said to be ?valid.
Presenting XML
Of course, while being able to design an XML page which accurately reflects your information is in itself an excellent tool to have, we still ultimately want to be able to present the information. Fortunately, XML also comes with ways to format your data for presentation, whether on the Internet, as a PDF or ?text file, or in a myriad of other useful formats.Many ?database managers are already capable of translating XML information, and this will become more common as the importance of XML increases. Furthermore, XML boasts a sister language which interfaces nicely with XML in order to provide formatted output. This sister language is called the E'''x'''tensible '''S'''tylesheet '''L'''anguage, or ?XSL.
With the many tools provided by XSL, you can now take huge amounts of XML information and present it in almost any imaginable format, up to and including HTML itself.
Why XML?
The needs of users have increased astoundingly. The days in which a one-tag-fits-all language like HTML are rapidly disappearing; data processing needs are as varied as the companies and individuals which have them. XML provides a way to break out of the thinking which says, "I need to make my information fit into an Internet-ready format," and instead gives you an Internet-ready format which can be adapted to fit your data.Formats of XML or XML Applications?
Just as you can present data and html in xml format for a browser, there are a wide group of applications that use some open standard formts of xml.- RSS Getting news feeds from sites.
- RDF Using documents as resources.
- XUL Xml-based graphical user interface.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
