Skip to main content
Our documentation has moved! This site will no longer be maintained. Please visit https://docs.prophecy.ai/ for the latest documentation.

XML

This page describes the XML-specific properties that appear in the Properties tab of Source and Target gems. These settings are the same for XML files regardless of which connection type is configured in the gem (for example, S3, SFTP, or SharePoint).

If you need details on configuring a Source or Target gem end to end (including all tabs such as Location), see the documentation for the specific file storage connection:

info

You can also use the upload file feature to use XML files. These will be stored in the SQL warehouse configured in your fabric.

Properties

Source properties

The following properties are available for the XML Source gem.

PropertyDescriptionDefault
DescriptionDescription of the table.None
Row TagXML tag that identifies a single row or record in the dataset.None
Inference Data Sampling LimitMaximum number of rows to sample for inferring the schema.0

Target properties

The following properties are available for the XML Target gem.

PropertyDescriptionDefault
DescriptionDescription of the table.None

Schema validation

Prophecy lets you enable schema validation for XML files. If you provide a schema, the Infer Schema button in the Properties tab will only run successfully if the source file schema matches the validation schema.

Prerequisites

To use schema validation, you need an XSD schema file in the same directory as your source XML file. If your schema uses xs:include or xs:import to reference external schemas, those referenced schema files must also be in the same directory.

Use XSD schema validation to ensure XML files conform to a predefined structure before processing.

  1. In the Location tab, toggle Enable XSD Schema Validation.
  2. Provide a path to the XSD file that you will use to validate against.
  3. Open the Properties tab.
  4. Click Infer Schema.

If the source file schema matches the validation schema, the schema will appear in the table.

If the schemas do not match, the infer schema process will fail. To troubleshoot, look for the error in the runtime logs. Here is an example error:

Failed due to error in "reports_xml". Error: XML validation failed against XSD schema for file /path/to/your/file.xml: /tmp/xml_val_1234567890.xml:117: element invalidElement: Schemas validity error : Element '{http://example.com/namespace/v1.0}invalidElement': This element is not expected. Expected is one of ( {http://example.com/namespace/v1.0}validElement1, {http://example.com/namespace/v1.0}validElement2, {http://example.com/namespace/v1.0}validElement3 ).

The following tabs display a sample XML file and a corresponding XSD schema file that would validate successfully.

<?xml version="1.0" encoding="UTF-8"?>
<users xmlns="http://example.com/users">
<user>
<id>1</id>
<name>John Doe</name>
<email>john.doe@example.com</email>
</user>
</users>