CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades

XML

XML
Introduction
XML document

XML basics

  • XML, which stands for Extensible Markup Language, is a method of structuring data using special tags.
  • XML can be used to exchange data between different systems, especially via the Internet.
  • XML documents that are stored in a file can be used as an alternative to binary files, text files, or even database systems for storing data.
  • When XML is stored in a file, the file name usually has an extension of xml.

Data for three products

Code Description Price
java Murach's Beginning Java 2 49.50
jsps Murach's Java Servlets and JSP 49.50
zjcl Murach's 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>Murach's Beginning Java 2</Description>
    <Price>49.50</Price>
  </Product>
  <Product Code="jsps">
    <Description>Murach's Java Servlets and JSP</Description>
    <Price>49.50</Price>
  </Product>
  <Product Code="zjcl">
    <Description>Murach's OS/390 and z/OS JCL</Description>
    <Price>62.50</Price>
  </Product>
</Products>
Previous | XML document | XML tags, declarations, and comments | XML elements | XML attributes | DTDs | Next