> For the complete documentation index, see [llms.txt](https://openendpoints.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openendpoints.gitbook.io/doc/configuration/data-source-transformation/data-source-post-processing.md). Agents can also search and read this documentation through its [MCP server](https://openendpoints.gitbook.io/doc/~gitbook/mcp).

# Data Source Post-Processing

A data source is a list of zero or many commands which fetch content from different content sources and produce XML. The resulting xml output is the input ("transformation-input") for XSLT to generate output documents.

Sometimes it makes sense to apply one or many intermediate steps to modify the loaded content before it becomes a "transformation-input". Possible reasons for this include

* You might want to reuse the same XSLT to generate an output document for different content sources, but these content-sources do not produce the exactly same structure of input. An intermediate transformation step can be used to "normalize" the input among different content sources.
* A complex transformation might be implement more elegant by splitting it into several subsequent steps.

A **data-source-post-processinig.xlt** can apply xml-transformations within the data-source object.

![data source post processing](https://cdn.openendpoints.io/images/gitbook/data-source-post-processing.png)

## How does it work?

In the **data-source-post-processing-xslt** directory under the application, there are zero or more files, each describing a post-processing transformation step. Each file is a XSLT which expects input-data with a root tag \<data-source-post-processing-input> and which shall produce any output xml with a root-tag \<data-source-post-processing-output>.

Content loaded from source A:

```xml
<data-source-post-processing-input>
    <any-xml/>
</data-source-post-processing-input>
```

Expected output:

```xml
<data-source-post-processing-output>
    <any-xml/>
</data-source-post-processing-output>
```

You can add zero or many data-source-post-processing.xslt to each content-source of your data-source object. For each content-source post-processing will be executed separately. Multiple steps for the same content-source will be executed subsequently in the order of post-processing-xslt files.

In addition you can apply the same logic for the entire data-source object. In this case all content-sources are loaded as a first stept, and post-processing applies for the collection of all content-sources.

```xml
<data-source>
    <xml-from-database>
        ...
        <post-process xslt="file-a.xslt"/>
    </xml-from-database>

    <xml-from-url ignore-if-error="true">
        ...
        <post-process xslt="file-b.xslt"/>
    </xml-from-url>

    <application-introspection>
        <post-process xslt="file-c.xslt"/>
    </application-introspection>

      <!--post-processing applied on the complete set of all content-sources-->
    <post-process xslt="file-X.xslt"/>
    <post-process xslt="file-Y.xslt"/>
    <post-process xslt="file-Z.xslt"/>
</data-source>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://openendpoints.gitbook.io/doc/configuration/data-source-transformation/data-source-post-processing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
