Introduction to XML

Data for three products:

Code Description Price
java Beginning Java 2 49.50
jsps Java Servlets and JSP 51.50
zjcl OS/390 and z/OS JCL 62.50

The products.xml document:

<?xml version="1.0" encoding=utf-8 ?>
<!- Product data –>
<Products>
<product code="java">
<Description>Beginning Java 2</Description>
<Price>49.50</Price>
</product>
<product code="jsps">
<Description>Java Servlets and JSP</Description>
<Price>51.50</Price>
</product>
<product code="zjcl">
<Description>OS/390 and z/OS JCL</Description>
<Price>62.50</Price>
</product>
</Products>

Descriptions:

  • Products is the root element
  • Product element Start and End tag
  • Code atribute
  • Description element
  • Price element

Descriptions:

  • The highest-level parent element in an XML document is known as the root element. An XML document can have only one root element
  • XML stands for Extensible Markup Language, is a method of structuring data using spcial tags.
  • XML can be used to exchange data between different systems, especially via the Internet.