1. Computing & Technology

How to Write a Schema for XML – XSD Validation Files for XML

Lessons in XML – Syllabus – Lesson 6

From

Schema is a relevant skill to have when learning XML. Not because you will use them often. Most formatting for XML works best with one of the XSL languages. However, schema offers a training benefit. You will learn some of the basics of element models and to interpret data types. These functions will help you understand what makes sound XML code. The concept of effective elements and nesting can be difficult to grasp. A brief examination of schema design can help explain the process.

Things You Need:

A basic text editor like Notepad (Windows) or TextEdit (Macintosh).

How to Write Your First XML Schema

Schema works within XML syntax rules. The file has a declaration statement and root element just like any XML code. This tutorial is the first to introduce you to the concept of namespaces. Formatting files for XML depends considerably on namespaces and uniform resource identifiers (URI). Understanding how they work is essential to learning to display XML data. This tutorial will get you started.

How to Pick an Element Type – Complex or Simple

Elements are the heart of XML. For formatting purposes, they come in two varieties: complex and simple. This tutorial explains the difference in elements and why the two styles are vital to proper XML design. When your XML education starts to move into more advanced processes, this understanding will help.

How to Break Down a Simple Element by Data Type

The concept of data types is something you see continuously in programming. Data types occur in formats that help to explain them. This tutorial provides a clear definition of each data type and its role. For extra credit, review ’How to Break Down a Complex Element by Data Type?‚ The second tutorial will refresh your knowledge of basic data and provide additional examples plus sample code.

HOMEWORK DAY 6: Open all XML practice files and write a schema declaration, statement, root element and namespace for each. Define the elements for your XML as either complex or simple and identify the data types.

If you would like help with the homework, or want to discuss the class, you can do so in the HTML / XML Forum.

Review Lesson 5

©2012 About.com. All rights reserved.

A part of The New York Times Company.