CIS 35A: Introduction to Java Programming

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

XML

XML
Introduction
XML tags, declarations, and comments

An XML document that contains data for one product

<?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>
</Products>

XML tags, declarations, and comments

  • Each XML tag begins with < and ends with >.
  • The first line in an XML document is an XML declaration that indicates which version of the XML standard is being used for the document.
  • The declaration also usually identifies the standard character set that's being used. For documents in English-speaking countries, UTF-8 is the character set that's commonly used.
  • You can use the <!-- and --> tags to include comments in an XML document.
Previous | XML document | XML tags, declarations, and comments | XML elements | XML attributes | DTDs | Next