Skip to content

XML translation - Doctype statement turns < and > characters into entity characters #143

@matsbert

Description

@matsbert

When translating XML documents, the doctype statement is not properly handled. The less than and greater than characters surrounding the DOCTYPE statement are being converted to entities:

Before translation:

<!ENTITY ICN-S1000DBIKE-AAA-D000000-0-U8025-00536-A-04-1 SYSTEM "ICN-S1000DBIKE-AAA-D000000-0-U8025-00536-A-04-1.CGM" NDATA cgm >

]>

After translation:

<!DOCTYPE dmodule[

<!ENTITY ICN-S1000DBIKE-AAA-D000000-0-U8025-00536-A-04-1 SYSTEM "ICN-S1000DBIKE-AAA-D000000-0-U8025-00536-A-04-1.CGM" NDATA cgm > ]&gt;

Code:

result = deepl_client.translate_text(
    text,
    tag_handling="xml",
    source_lang="SV",
    target_lang="EN-GB",
    model_type="prefer_quality_optimized",
    non_splitting_tags="div",
    split_sentences="nonewlines"
)

I have heard that DeepL is working on improving the tag handling, is there an expected timeframe for this?

Any settings that could help improve this situation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions