# Viewing the XML Schema

> Source: https://docs.synthesized.io/tdk/latest/user_guide/020_guides/generating_data/xml_schema_view
> For the complete documentation index, see [llms.txt](https://docs.synthesized.io/llms.txt).

View the structure of an XML data source so you can target the right paths when customising XML generation.

## Overview

Before you write YAML customizations for XML generation (see [Generating XML Files](https://docs.synthesized.io/tdk/latest/user_guide/020_guides/generating_data/xml_files_generation)), you need to know the element and attribute paths in your source file. The schema view shows the detected structure of an XML data source, so you can copy the paths straight into your configuration instead of guessing them from the raw file.

## Prerequisites

1. An XML data source already added to your project.
2. A workflow connected to that XML data source.

## Steps

1. Open the project containing the XML data source.
  
  ![Open the project containing the XML data source.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-1.png)
2. Open a workflow connected to the XML data source.
  
  ![Open a workflow connected to the XML data source.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-2.png)
3. Click the source file to open it.
  
  ![Click the source file to open it.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-3.png)
4. Open the **Generate Preview** tab.
  
  ![Open the \*Generate Preview\* tab.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-4.png)
5. Click **Generate Preview**.
  
  ![Click \*Generate Preview\*.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-5.png)
6. Open the schema view for the source.
  
  ![Open the schema view for the source.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-6.png)
7. Expand the elements to see nested paths and attributes.
  
  ![Expand the elements to see nested paths and attributes.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-7.png)
8. Note the path of the element or attribute you want to target.
9. Use that path in your YAML customization under `generation`.
  
  ![Use that path in your YAML customization under \`generation\`.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-9.png)

## Example

Given a schema view showing a nested `customer/address/city` element, target it in your configuration like this:

```yaml
generation:
  xml:
    - path: "customer/address/city"
      type: string
```

For attribute and text-content targeting syntax, see [Generating XML Files](https://docs.synthesized.io/tdk/latest/user_guide/020_guides/generating_data/xml_files_generation).

## Confirm Success

The schema view lists every element and attribute path present in the source file. If a path you expect is missing, check that the source file was parsed without errors.

## Next Steps

- [Generating XML Files](https://docs.synthesized.io/tdk/latest/user_guide/020_guides/generating_data/xml_files_generation) — write YAML customizations using the paths you found.
- [Configuration Reference](https://docs.synthesized.io/tdk/latest/user_guide/040_reference/configuration/configuration_reference) — full list of generation options.

## Screens

![source file tab](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/screen-1.png)

Figure 1. source file tab

![generate preview tab](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/screen-2.png)

Figure 2. generate preview tab

## Inspecting the Raw XSD

The XML view also lets you inspect the raw XSD behind the detected schema structure (see [Viewing the XML Schema](https://docs.synthesized.io/tdk/latest/user_guide/020_guides/generating_data/xml_schema_view)), without leaving the workflow - useful when a path in the schema view looks wrong and you want to check the source definition directly.

### Steps

1. Open the XML view for the source.
  
  ![Open the XML view for the source.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-10.png)
2. Open the raw XSD.
  
  ![Open the raw XSD.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-11.png)
3. Compare the raw definition against the paths shown in the schema view.
  
  ![Compare the raw definition against the paths shown in the schema view.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-12.png)

## Resolving Missing XSD Dependencies

An XSD can `import` or `include` other schema files. If one of those dependencies is not available, the XML view flags it instead of failing silently.

### Steps

1. Open the XML view for the source.
2. Check for a notice about a missing XSD dependency.
  
  ![Check for a notice about a missing XSD dependency.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-14.png)
3. Resolve the missing dependency so the schema can be loaded.
4. Reopen the XML view to confirm the structure loads in full.
  
  ![Reopen the XML view to confirm the structure loads in full.](https://docs.synthesized.io/tdk/latest/user_guide/_images/xml_schema_view/step-16.png)
