////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /pipeline/transforms/
:language: en_US
:description: The XSD Validator transform performs an XSD validation against data in a file or in an input field.

= image:transforms/icons/XOU.svg[XSD Validator transform Icon, role="image-doc-icon"] XSD Validator

[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
== Description

The XSD Validator transform performs an XSD validation against data in a file or in an input field.

XSD is short for link:http://en.wikipedia.org/wiki/XML_Schema_(W3C)[XML Schema Definition].

As such, there are 2 entities at work here:

* The XML you want to validate the layout for
* The XSD (Schema) file that describes what the XML file should look like.

To make matters more complex, it's possible to store the XSD inside the XML itself.

See also the xref:workflow/actions/xsdvalidator.adoc[XSD Validator workflow action].

|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
!===
!Hop Engine! image:check_mark.svg[Supported, 24]
!Spark! image:question_mark.svg[Maybe Supported, 24]
!Flink! image:question_mark.svg[Maybe Supported, 24]
!Dataflow! image:question_mark.svg[Maybe Supported, 24]
!===
|===

== Options

[options="header"]
|===
|Option|Description
|Transform name|Name of the transform.
|XML Source a|

* XML source is a file : check this if the XML file is defined as a filename in the XML field
* XML field : the field to read that contains the XML filename or the XML content itself

|Output fields a|

* Result fieldname : the name of the result field
* Output String field : check this option if you want to specify specific messages after validation:
** Display if XML is valid : the message if the XML was valid.
** Display if XML is not valid : the message if the XML wasn't valid.
* Add validation msg in output : check this if you want to add a validation message in the output.
* Validation msg field: the name of the validation message field.

|XML schema definition a|

XSD source : select one of these options:

* The XSD source is a file, let me specify the filename (specify below in the XSD filename field).
* The XSD source is a file, defined in a field (specify below in the XSD filename field).
* The XSD source is defined inside the source XML.
|===
