blob: 102ecfa7795d1464caa8c4f5bb6c0f2d3fb05f2e [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../../..//default_style.css" type="text/css">
<link rel="stylesheet" href="../../../..//webtools/wtp.css" type="text/css">
<title>Validation Tutorial</title>
</head>
<body>
<table width="100%" cellspacing="5" cellpadding="2" border="0">
<tbody>
<tr>
<td width="60%" align="left"><font class="indextop">Validation Tutorial</font>
<br>
<font class="indexsub">Validation Tutorial</font></td><td width="40%"><img width="207" hspace="50" height="129" align="middle" src="../../../..//webtools/images/wtplogosmall.jpg"></td>
</tr>
</tbody>
</table>
<table width="100%" cellspacing="5" cellpadding="2" border="0">
<col width="16">
<col width="*">
<tbody>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<p>
<b>By Richard Mah</b>
<BR>
Created on December 22, 2004<BR>
Updated on August 10, 2005<BR>
<BR>
Eclipse WTP includes validation tools for XML, DTD, and XML Schema. Validation can be invoked manually or automatically after every save.
</p>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<div align="right">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font face="Arial,Helvetica"><font color="#ffffff">Manually Invoking the Validator</font></font></b></td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<P>The validator can be invoked manually by right-clicking on a resource (XML, DTD, or XML Schema file), and selecting the "Validate (XML/DTD/XML Schema) File" menu item. See <B>Figure 1</B>.
</P>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><B>Figure 1</B></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><img border="0" src="images/Validate_XML_Menu.jpg"></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<P>Manually invoking the validator will display a message dialog informing the user the validity of the resource. For example, the dialog shown in <B>Figure 2</B> will be displayed when a valid XML file is validated.
</P>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><B>Figure 2</B></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><img border="0" src="images/Validate_XML_Success.jpg"></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<P>Similarly, the dialog shown in <B>Figure 3</B> will be displayed when an invalid XML file is validated.
</P>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><B>Figure 3</B></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><img border="0" src="images/Validate_XML_Fail.jpg"></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<div align="right">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font face="Arial,Helvetica"><font color="#ffffff">Automatically Invoking the Validator After Every Save</font></font></b></td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<P>
To invoke the validator after every save, right-click on the project (XMLExamples) and select Properties. Select the "Validation" heading and select the "Override validation preferences" checkbox. Also select the "Run validation automatically when you save changes to XMLExamples resources." checkbox. <B>See Figure 4</B>.
</P>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><B>Figure 4</B></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><img border="0" src="images/Validate_XML_Save_Dialog.jpg"></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<P>
No message dialogs will appear with results from the validation. Only updates to the Problems view will be done. If the resource being validated is valid, no errors will appear in the Problems view. If there are problems, new entries will be created in the view.
</P>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<div align="right">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font face="Arial,Helvetica"><font color="#ffffff">Locating Errors in the Resource</font></font></b></td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<P>
Further information explaining the cause of the validation error will appear in the Problems view (To open the Problems view, select Problems from the menu bar. Window --&gt; Show View --&gt; Problems). Selecting the error in the Problems view will highlight the error in the Source view allowing users to quickly locate and correct the problem. See <B>Figure 5</B>.
</P>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><B>Figure 5</B></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<BR>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top"><img border="0" src="images/Validate_XML_Problems_View.jpg"></td>
</tr>
</tbody>
</table>
</body>
</html>