Customized XML outline detection

Learn how to customize XML outline detection with the DeepL API.

Automatic detection of the XML structure will not always yield the best results in all XML files. You can disable this automatic mechanism by setting the outline_detection=0 and selecting the tags that should be considered structure tags. This will split sentences using the splitting_tags parameter.

In the example below, we achieve the same results as the automatic engine by disabling automatic detection and setting the parameters manually:

Parameters
tag_handling=xml, split_sentences=nonewlines, outline_detection=0, splitting_tags=par,title
Example request
<document>
  <meta>
    <title>A document's title</title>
  </meta>
  <content>
    <par>This is the first sentence. Followed by a second one.</par>
    <par>This is the third sentence.</par>
  </content>
</document>
Example response
<document>
  <meta>
    <title>Der Titel eines Dokuments</title>
  </meta>
  <content>
    <par>Das ist der erste Satz. Gefolgt von einem zweiten.</par>
    <par>Dies ist der dritte Satz.</par>
  </content>
</document>

While this approach is slightly more complicated, it allows for greater control over the structure of the translation output.

Last updated