# tXSDValidator

Helps at controlling data and structure quality of the file or flow to be processed.

tXSDValidator validates an input XML file or an input XML flow against an XSD file and sends the validation log to the defined output.

## tXSDValidator Standard properties

These properties are used to configure tXSDValidator running in the Standard Job framework.

The Standard tXSDValidator component belongs to the XML family.

The component in this framework is available in all Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| Mode | Select the validation mode from the drop-down list.<br><br><ul> <li> <p> <span>File Mode</span>: to validate an                                    input file.</p> </li> <li> <p> <span>Flow Mode</span>: to validate an                                    input flow.</p> </li> </ul> |
| Schema and Edit<br>schema | A schema is a row description. It defines the number of fields to be<br>processed and passed on to the next component.<br><br>Note that when File Mode is selected<br>from the Mode list, the schema of this<br>component is read-only and it contains standard information regarding<br>the file validation. |
| XSD file | Specify the path to the XSD reference file. The HTTP URL is also<br>supported, for example,<br>*http://localhost:8080/book.xsd*.<br><br>This field is available only when File<br>Mode is selected from the Mode drop-down list. |
| XML file | Specify the path to the XML file to be validated.<br><br>This field is available only when File<br>Mode is selected from the Mode drop-down list. |
| If XML is valid, display | Type in the message to be displayed on the console if the XML file is<br>valid.<br><br>This field is available only when File<br>Mode is selected from the Mode drop-down list. |
| If XML is invalid, display | Type in the message to be displayed on the console if the XML file is<br>invalid.<br><br>This field is available only when File<br>Mode is selected from the Mode drop-down list. |
| Print to console | Select this check box to display the validation message on the<br>console.<br><br>This check box is available only when File<br>Mode is selected from the Mode drop-down list. |
| Allocate | Click the [+] button to add as many<br>rows as needed, and in each row set the value of the following<br>columns:<br><br><ul> <li> <p> <span>Input Column</span>: click the cell                                    and select a column to be validated.</p> </li> <li> <p> <span>XSD File</span>: enter the path to                                    the corresponding XSD reference file.</p> </li> </ul><br><br>This table is available only when Flow<br>Mode is selected from the Mode drop-down list. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Enable Features | Click the [+] button to add as many<br>rows as needed, and in each row enter the feature to be enabled on the<br>underlying parser between double quotation marks, for example, *"http://apache.org/xml/features/honour-all-schemaLocations"*.<br><br>For more information about the features, see https://xerces.apache.org/xerces2-j/features.html. |
| Encoding | Enter the encoding type between double quotation marks. |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br><br>DIFFERENCE: the result of the<br>validation. This is a Flow variable and it returns a string.<br><br><br>VALID: the validation result. This is a Flow variable<br>and it returns a Boolean.<br><br><br>XSD\_ERROR\_MESSAGE:<br>the xsd error message generated by the component. This is a Flow variable and it returns<br>a string.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | When File Mode is selected, this<br>component can be used as a standalone component but it is usually linked<br>to an output component to gather the log data. |

**Related concepts**

* [Validating data flows against an XSD file](https://help.qlik.com/talend/en-US/components/8.0/xml-validation/txsdvalidator-tfileoutputdelimited-tfileinputdelimited-tfileinputdelimited-validating-data-flows-against-xsd-file-standard-component-this)