HTML Validation
Oxygen XML Developer includes a built-in default validator used for validating HTML documents. It is based upon the W3C HTML Validator and the HTML documents are validated against the W3C HTML5 specification. The validator in Oxygen XML Developer only supports HTML5 structure. It presents the errors in the editor similar to XML documents. It also checks the embedded CSS content and the warnings and errors are presented similar to the CSS editor.
Validating HTML Against a Schematron
- Configure a Validation Scenario - You can create or edit a validation scenario, change the File type column to HTML Document, change the Validation engine column to HTML Schematron Validator, and specify the Schematron document in the Schema column.
- Manually Validate a Single Document - You can use the Validate with action from the Validation drop-down menu on the toolbar. This opens a dialog box where you can specify the Schematron document to validate the current document against.
- Batch Validate Multiple Documents - You can select multiple HTML documents in the Project view, right-click, and use the Validate with schema action from the Validate submenu. This opens a dialog box where you can specify the Schematron document to validate the selected documents against.
- The Schematron must use the HTML5 namespace to reference the elements from the instance.
- Implicit HTML elements (i.e.
<html>
,<body>
,<tbody>
) must be included in an XPath expression in the Schematron document, even if they are missing from the HTML document.
Validating HTML Against Other Types of Schema
If your HTML document is XML well-formed, you could also configure a validation scenario to validate it as an XML document against other types of schemas. You would create or edit a validation scenario, make sure the File type column is set to XML Document, select the appropriate Validation engine, and specify the schema document in the Schema column.