blob: 2221bb1d791ad0e72c3ff886709e2ec25cc0ede1 [file] [log] [blame]
<html>
<head>
<meta
http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<meta
content="text/html; charset=iso-8859-1"
http-equiv="Content-Type">
<link
type="text/css"
href="../../../..//default_style.css"
rel="stylesheet">
<link
type="text/css"
href="../../../..//webtools/wtp.css"
rel="stylesheet">
<title>Validation Tutorial</title>
</head>
<body>
<table
border="0"
cellpadding="2"
cellspacing="5"
width="100%">
<tbody>
<tr>
<td
align="left"
width="60%"><font class="indextop">Validation Tutorial</font> <br>
<font class="indexsub">Validation Tutorial</font></td>
<td width="40%"><img
src="../../../..//webtools/images/wtplogosmall.jpg"
align="middle"
height="129"
hspace="50"
width="207"
alt=""></td>
</tr>
</tbody>
</table>
<table
border="0"
cellpadding="2"
cellspacing="5"
width="100%">
<col width="16">
<col width="*">
<tbody>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top">
<style type="">
</style>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top">
<p><b>By Richard Mah and Nitin Dahyabhai</b> <br>
Created on December 22, 2004<br>
Last updated on March 24, 2008<br>
<br>
The Web Tools Platform includes validation tools for XML, DTD, and XML Schema files. This tutorial
demonstrates how validation can be invoked manually or automatically during builds.</p>
</td>
</tr>
<tr>
<td
colspan="2"
align="left"
bgcolor="#0080c0"
valign="top"><b><font
color="#ffffff"
face="Arial,Helvetica"><b>Manually Invoking the Validator</b></font></b></td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top">
<p>Validation can be invoked manually on a resource or group of resources (including but not limited to
XML, DTD, and XML Schema files) by invoking the "Validate" context menu item. See Figure 1. <br>
<br>
</p>
<table>
<tr>
<td><img
border="0"
src="images/invoking.png"
alt=""></td>
</tr>
<tr>
<td align="right"><em>Figure 1</em></td>
</tr>
</table>
<p></p>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top">
<p><br>
<br>
Manually invoking validation will run validation in the background. See Figure 2. <br>
<br>
</p>
<table>
<tr>
<td><img
border="0"
src="images/running.png"
alt=""></td>
</tr>
<tr>
<td align="right"><em>Figure 2</em></td>
</tr>
</table>
<p></p>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top">
<p><br>
<br>
When validation completes, you will be presented with a validation results dialog, and any problems found will
be shown in the <b>Problems</b> view. To open the <b>Problems</b>
view, select <b>Problems</b> from the menu bar (Window --&gt; Show View --&gt; Problems). See Figures 3 and 4. <br>
<br>
</p>
<table>
<tr>
<td><img
border="0"
src="images/results.png"
alt=""></td>
</tr>
<tr>
<td align="right"><em>Figure 3</em></td>
</tr>
</table>
<br>
<br>
<table>
<tr>
<td><img
border="0"
src="images/problems.png"
alt=""></td>
</tr>
<tr>
<td align="right"><em>Figure 4</em></td>
</tr>
</table>
<p></p>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top"><br>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top"><br>
</td>
</tr>
<tr>
<td
colspan="2"
align="left"
bgcolor="#0080c0"
valign="top"><b><font
color="#ffffff"
face="Arial,Helvetica"><b>Automatically Invoking the Validator during Builds</b></font></b></td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top">
<p>To run validation as part of building, the <i>Validation Builder</i> must be set on the project and
the desired validators enabled. To ensure that the builder is set onto the project, open the Properties
dialog for the project and go to the Validation property page. If the <b>Add Validation Builder to
project</b> checkbox is present, enable it. Then, enable the <b>Build</b> checkbox for the desired validators,
overriding the main validation preferences if necessary. See Figure 5. <br>
<br>
</p>
<table>
<tr>
<td><img
border="0"
src="images/project-properties.png"
alt=""></td>
</tr>
<tr>
<td align="right"><em>Figure 5</em></td>
</tr>
</table>
<br>
<br>
Validation will now be performed on files as they are built, updating the <b>Problems</b> view
automatically.
<p></p>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top"><br>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top"><br>
</td>
</tr>
<tr>
<td
colspan="2"
align="left"
bgcolor="#0080c0"
valign="top"><b><font
color="#ffffff"
face="Arial,Helvetica"><b>Locating Errors in the Resource</b></font></b></td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top">
<p>Further information explaining the cause of the validation error will appear in the Problems view.
Selecting the error in the <b>Problems</b> view and either double-clicking on it or choosing <b>Go To</b>
from its context menu will highlight the error in the Source view allowing users to quickly locate and
correct the problem. See Figure 7.</p>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top"><br>
</td>
</tr>
<tr>
<td
align="right"
valign="top">&nbsp;</td>
<td valign="top">
<table>
<tr>
<td><img
border="0"
src="images/goto.png"
alt=""></td>
</tr>
<tr>
<td align="right"><em>Figure 6</em></td>
</tr>
<tr></tr>
<tr>
<td><img
border="0"
src="images/results.png"
alt=""></td>
</tr>
<tr>
<td align="right"><em>Figure 7</em></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>