XML Translator: Translate XML Files With Tags, Attributes and CDATA Intact

An XML translator translates the human-readable text between the tags while preserving the markup itself — so the file that comes back is well-formed XML your system can ingest, in any of 280+ languages.

You tell Smartcat’s software localization platform which elements and attributes hold translatable text — by XPath, once — and everything outside those paths is left alone.

Translate any file. In seconds.
Images, docs, video, audio, courses — pick a format and drop your file.
Drop documents here
or browse files · Supports .docx, .pdf, .pptx, .xlsx and more
From
To

Translate

More than 80 of the world’s largest companies have chosen Smartcat

What is an XML translator?

An XML translator, sometimes called an XML content translator, is software that translates the readable text in an XML file and leaves the markup alone, so the translated file is still well-formed XML your system can import. It translates element text and the attribute values you choose, never element names, attribute names or IDs.

XML translation means translating an XML file’s text content while leaving its markup machine-readable. Smartcat’s XML translator uses a configurable XML parser rather than guessing: you supply an XPath to the segment-forming elements once, and every file of that shape follows the same rules.

Developers, documentation writers and localization managers translate XML files most often, usually a language file or export that another system generates on a schedule.

280+

languages

Translate one XML export into 280+ languages, including right-to-left languages, in a single project.

80+

file formats

Beyond XML, translate the JSON, YAML, XLIFF, PO and RESX files around a release in the same project.

92%

accepted unedited

92% of words translated by Smartcat AI are accepted without a single human edit.

Uploading an XML file to Smartcat’s online XML translator

Upload an XML file, get XML back

Drop one .xml file or a whole export into Smartcat. The nodes your parsing rules point at open in the translation editor as segments, and everything else stays exactly as it was in the file you sent.

Why does XML break in ordinary translators?

XML breaks in ordinary translators because they can’t tell markup from prose: they translate tag and attribute names, “fix” entities and mangle CDATA. Then your import rejects the file at 5 p.m., right before a release.

In an ordinary translator

Text and markup mixedFixed after import

In Smartcat’s XML translator

XPath rulesStructure untouched

Tags and attributes get translated

<button label="Submit"> comes back as <bouton étiquette="Envoyer">, and your parser has never heard of <bouton>.

Only the nodes you point at

Element and attribute names are never translated. An attribute such as label becomes a segment only because your XPath points at it, while id and enum values never enter the editor.

Entities and encoding drift

&amp; becomes a bare ampersand and the file stops parsing, or the declaration says one encoding while the content says another, and the mismatch surfaces as mojibake three systems downstream.

Tested on your file, not promised

Smartcat writes the translated text back into the original structure. For entity and encoding behavior, the Smartcat team would rather test a sample of your file with you than print a promise.

CDATA gets mangled

A <![CDATA[ … ]]> block holding embedded HTML is exactly the thing naive tools mangle first.

HTML in CDATA protected

With Protect HTML tags in CDATA sections on, the HTML inside CDATA becomes Smartcat tags that translators can move but not break.

Fields overflow your schema

A field your schema caps at 40 characters overflows in German, and the import fails after translation.

Length limits in the editor

Map a limit such as @max to each segment. A linguist cannot confirm a translation that runs over it.

What an XML translator preserves, element by element

Smartcat’s XML translator preserves every element name, attribute name, ID and declaration, and translates only the text nodes and attribute values your XPath rules select. Everything else is opt-in by design: the table shows each part of an XML file and where you control it.

XML partWhat Smartcat doesHow you control it
Element and attribute namesNever translated. Structure is never edited, so what comes back parses.Nothing to set
Attribute valuesNot translated unless you name that attribute as segment-forming, so you point at label and never at id or an enum value.An XPath to the attribute, for example @label
Text nodesTranslated where they are segment-forming, and checked against your translation memory and glossary.Segment-forming elements; untranslatable inline nodes are excluded by their own path
CDATA sectionsWith Protect HTML tags in CDATA sections on, HTML inside CDATA is substituted by Smartcat tags; with it off, those tags appear as editable text.One checkbox per parsing model
String IDsShown under each segment and used to update a newer version of the file while keeping revisions and assignments.A path to one unique node, for example @id
CommentsShown to translators in the segment comments.One or more paths to comment nodes
Length limitsA linguist cannot confirm a translation longer than the limit.A path to the limit, for example @max

Decide the CDATA checkbox deliberately, because off means a translator can edit your markup. The one structural requirement is repeating elements: each repetition becomes a segment, so a one-off document with no repeating structure is not a fit for the custom parser. Spec background: XML 1.0 [1] and XPath 1.0 [2]; parser fields [5].

One XML file, annotated

Parsing model for this file: segment-forming elements //string, translatable attribute @label, string ID @id, length limit @max, Protect HTML tags in CDATA sections on.

<?xml version="1.0" encoding="UTF-8"?>
<strings>
  <string id="checkout_cta" max="24" label="Checkout button">Proceed to checkout</string>
  <string id="promo_body"><![CDATA[Save <b>20%</b> today]]></string>
</strings>
  • Translated
  • Locked: names, IDs, limits, declarations
  • Protected tag: translators can move it, not edit it

How to translate XML files in Smartcat

To translate an XML file, upload it to Smartcat, point the parser at the elements and attributes that hold text, translate with your glossary and translation memory, review, and download well-formed XML. Use the six steps below to translate an XML file or a whole export in the browser.

  1. Upload your XML files

    Upload one .xml file or several at once, including recurring exports. A full locale export goes into one project and shares one glossary and one translation memory.

  2. Point the parser at your text

    Supply an XPath to the segment-forming elements, the nodes you want in the translation editor. A segment can be an element, an attribute or text, so label is translated because you pointed at it, and id never is.

  3. Add IDs, comments and limits

    Map string IDs, translator comments and per-segment length limits by their own paths, and decide whether HTML inside CDATA is protected. The same rules apply to every future file of that shape.

Smartcat editor with English UI strings translated into German and the string ID shown under each segment

String IDs in the editor

Each segment shows its string ID under the source text, so reviewers know where a string is used, and a newer version of the file updates segments by ID.

  1. Translate with your glossary

    The Content Translator Coworker translates each segment with your glossary and translation memory applied, into every target language at once.

  2. Review in the editor

    Open the split-screen editor and assign team members or vetted reviewers from the Smartcat Marketplace. Length limits and QA warnings show while they work.

  3. Download well-formed XML

    Download each file, or select whole projects and get everything back as one ZIP in the original formats, sorted into folders. The text is written back into the original structure.

See the XML parser configured on your own file

XML, XLIFF, JSON and YAML in the same project

Smartcat’s XML translation software keeps every string file of a release in one project, with one glossary and one translation memory. These are the parts product and documentation teams use most.

See XPath rules set up on your own XML export

XML localization: DITA, Android strings.xml and XPath rules

XML localization means translating every XML file a product ships, from DITA documentation to Android strings.xml resources, without breaking the markup. Smartcat handles DITA XML and DITAMAP files, Android XML string resources and any custom schema through XPath rules. Sources for the specs are listed under the FAQ.

DITA XML translation for technical documentation

For documentation teams that author in DITA [4].

DITA XML and DITAMAP files

Smartcat accepts DITA XML topics and DITAMAP files. Upload a ZIP package and it keeps its folder structure and is handled as one file.

File types

.dita.ditamap.zip

Translated DITA XML and DITAMAP files come back with their DOCTYPE declarations and entities intact, ready for your own build.

Adobe Experience Manager Guides

Teams on AEM Guides send content to Smartcat with the Smartcat plugin, then review the translated files in the translation project.

  1. Pick a mapIn the AEM Guides Map Console
  2. Send to translationChoose the target language
  3. Review filesIn the Smartcat project

Translate Android strings.xml files

For app teams that need a strings.xml translator that keeps every resource name [3].

Android XML translation that keeps every key

Smartcat translates Android strings.xml files online, the res/values resource often searched as string.xml. In a software localization project, strings import and export with their key IDs, the same as JSON, YAML and iOS .strings.

  • <string name="checkout_cta">
    Keeps its name, so R.string.checkout_cta resolves in every locale
  • Proceed to checkout
    The only part that is translated

Android plurals and CI/CD

A key can be created with all its plural forms, and plurals export as ICU MessageFormat-compatible strings.

  • Import and export through the UI, REST API or CLI
  • Run it from CI/CD on every build
  • Several key collections in one project

XPath rules for custom XML schemas

For any XML schema, configured once per file shape [5].

Length limits with @max

Set the path to a node that holds the allowed number of characters. A linguist cannot confirm a translation that runs over it.

  • <test-string max="10">
    Segment-forming element //test-string, length limit @max

String IDs and comments

A String ID path picks one unique node per segment. Updates then match segments by ID, keeping revisions and assignments [6].

  • @id
    Shown under the segment; must be unique in the file
  • <comment>@com
    Shown to translators as segment comments

CDATA sections with HTML inside

Check Protect HTML tags in CDATA sections and the HTML inside CDATA becomes Smartcat tags. Leave it unchecked and those tags are editable text.

Checked
  • HTML tags locked
  • Text around them translated
Unchecked
  • Tags are editable text
  • A translator can edit your markup

Untranslatable inline elements

Set a path in the untranslatable inline elements field, and Smartcat shows that element as a tag instead of text, hiding technical pieces you don’t want translated.

Typical uses

Product codesVariablesInline markup

Re-export every sprint without losing the work

For teams that ship the same XML export every release.

The second upload is what matters

Translations carry over and linguists stay assigned instead of being re-invited each sprint.

  1. New exportSame file name
  2. Update by IDRevisions kept
  3. Only changesNew and changed strings billed

One platform, start to finish

Creation, translation, review and delivery stay in one platform, with repetitive steps automated and Smartwords consumed only for retranslation.

  • Glossary and translation memory on every file
  • Reviewers in the same project
  • One ZIP back in the original formats

The AI coworkers that translate and check your XML files

Each coworker handles one step of XML translation, from the first draft to the final check. Your reviewers approve every language before export.

Connect Git, the CLI and the REST API to your XML exports

Send XML and string files from your repository, documentation platform or CMS, or connect through the REST API and CLI. See all integrations

How Kaseya and Huel localize product content with Smartcat

Kaseya’s product documentation team localizes UI strings and docs in 10+ languages, and Huel localizes web and product content across markets. Each number below comes from their case studies.

70%

lower localization costs

Kaseya cut localization costs by 70% after replacing a quote-per-request vendor model, and reinvested the savings in 8+ more languages.

10+

languages

Kaseya localizes UI and documentation in 10+ languages across multiple product lines, without increasing its budget.

50%

lower operational costs

Huel’s operational costs fell by 50% as it scaled localization across web, CRM and ads without adding headcount.

Kaseya logo
“We’re coding with AI, so we’re releasing product updates every day, a couple times a day. There’s no way to keep up with that. This rate of change is one of the reasons why Smartcat is so necessary.”

Kaseya’s product documentation team connected Smartcat to GitHub, so UI strings committed by developers sync to Smartcat for translation and flow back into the repository.

Read the Kaseya case study
Ellen KellyDirector of Product Documentation, Kaseya

See your own XML export translated with its markup intact

What product and localization teams say on G2

What documentation and dev teams ask before they send XML

Documentation and engineering teams ask four things before they move XML localization to Smartcat: custom schemas, DTD or XSD validation, re-exports every sprint, and one-off documents, the one case the XML parser is not built for.

“Our XML uses a custom schema.”

Smartcat doesn’t guess your schema: you configure the XML parser once per file shape, by XPath.

What you set

  • Segment-forming elements and translatable attributes
  • Untranslatable inline elements
  • String IDs, comments and length limits

“Will the output validate against our DTD or XSD?”

Well-formedness comes from the parse model, because structure is never edited.

Schema validity also depends on content: German often runs longer than English. Set a length limit, and run your own schema validation on the first files per language pair.

“We re-export the same file every sprint.”

Set a String ID path and upload the newer version as an update: segments match by ID, so revisions and assignments stay.

Translations carried overLinguists stay assignedNew and changed strings billed

“Can it translate a one-off XML document?”

Not with the custom parser: it needs repeating elements, because each repetition becomes a segment.

A document with no repeating structure is not a fit for the custom parser. Bring a sample to a demo, and we’ll check how it parses before you commit.

How Smartcat protects the XML files you translate

XML exports often describe features that haven’t shipped yet. Smartcat protects that content at every step; see how on the Smartcat security page.

Role-based access controls

Set who can view, translate, review and approve files by team, role or region on enterprise plans.

SOC 2 Type II compliant

Smartcat is SOC 2 Type II compliant and isolates every workspace.

ISO 27001 certified

Smartcat is an ISO 27001 certified organization.

Never used to train public AI models

Your strings and documentation are never used to train public AI models.

Audit trails

See who changed what and when across translation and review on enterprise plans.

Encryption and deletion on request

Content is encrypted in transit and at rest, and deleted or returned within 30 days of a written request.

Resources for XML translation

Guides from the Smartcat blog on software localization, Android string resources and XLIFF, the XML format built for translation.

XML translator FAQ

What is an XML translator?

An XML translator translates the readable text inside an XML file and writes it back into the same tags, so the file still parses. Smartcat’s XML translator lets you choose by XPath which elements and attributes hold text. Element names, attribute names and IDs are never translated, and the file comes back as well-formed XML in any of 280+ languages.

What is the best XML translator?

The best XML translator never touches your markup and lets you decide what counts as text. Check four things: XPath control over elements and attributes, CDATA handling, length limits translators can see, and updates that keep earlier work. Smartcat covers all four and applies your translation memory and glossary. It is not built for one-off XML documents with no repeating elements.

Can I use Smartcat as an XML translator online?

Yes. Smartcat works as an XML translator online, in the browser, with nothing to install. To translate an XML file online, upload it, set the parser rules once, pick your languages and review the translation in the online editor. Then download each translated file, or the whole project as one ZIP in the original formats.

How do I translate an XML language file?

An XML language file holds an app’s or product’s interface strings, one element per string. To translate one in Smartcat, upload the file, point the parser at the string elements and their IDs, and choose your target languages. Smartcat returns one translated XML language file per language, with element names, IDs and structure unchanged.

How do I translate an XML file?

To translate an XML file in Smartcat, upload it, give an XPath to the elements that hold text, and pick your target languages. AI translates each segment with your glossary and translation memory, reviewers check it in the editor, and Smartcat writes the text back into the original structure. You download well-formed XML in the same shape as the file you sent.

What is an XML file?

An XML (Extensible Markup Language) file stores data as text between custom tags, so both people and machines can read it. Smartcat translates XML files from app settings, product feeds, CMS exports, help content and eLearning packages. Because the tags carry meaning for the system that reads the file, the text has to be translated while every tag stays as it was.

Can I control which attributes get translated?

Yes. In Smartcat’s XML parsing configuration you give an XPath for the segment-forming elements, and a segment can be an element, an attribute or text. An attribute is translated only if you point at it, so label becomes a segment while id and enum values never enter the editor. Separate paths cover untranslatable nodes, string IDs, comments and length limits.

How do I translate XML files while preserving tags?

Smartcat preserves tags by design: element and attribute names are never edited, and only the nodes your XPath points at become editable segments. HTML inside CDATA can be protected as Smartcat tags that translators can move but not break. The translated text is written back into the original structure, so the download has the same shape as the file you sent.

What happens to CDATA sections with HTML inside?

You decide in Smartcat with one checkbox, Protect HTML tags in CDATA sections. Checked, the HTML tags inside the CDATA block are replaced by Smartcat tags, so translators can move them but not break them. Unchecked, those tags appear as editable text, and a translator could change your markup. For anything a machine reads after translation, leave the box checked.

Can I translate Android strings.xml files online?

Yes. Smartcat translates Android strings.xml files online and supports Android XML, and in a software localization project you import and export strings with their key IDs, so <string name="checkout_cta"> keeps its name and R.string.checkout_cta resolves in every locale. A key can hold all its plural forms, and plurals export as ICU MessageFormat-compatible strings. Import and export run through the UI, REST API or CLI.

Does Smartcat translate DITA XML?

Yes. Smartcat accepts DITA XML topics and DITAMAP files, and a ZIP package keeps its folder structure. Teams on Adobe Experience Manager Guides can send content to Smartcat with the Smartcat plugin and review the translated files in the project. Translated DITA XML and DITAMAP files come back with their DOCTYPE declarations and entities intact.

What XML formats does Smartcat support?

Smartcat supports standard XML, Android XML, DITA XML and DITAMAP, and XLIFF 1.2 and 2.0, plus custom schemas through the XML parsing configuration. XLIFF has its own workflow on the XLIFF translation editor page. For a custom schema, you configure the parser once per file shape, and the file needs repeating elements for Smartcat to segment on.

Can I update an XML file without losing translations?

Yes. Upload the newer file to the same Smartcat project with exactly the same file name, and Smartcat offers to update the existing document instead of adding a new one. With a String ID path set, each ID must be unique in the file; segments then match by ID, so revisions and assignments carry over. Without IDs, earlier translations still come back from translation memory.

How much does XML translation cost in Smartcat?

Smartcat prices XML translation by usage in Smartwords, not by file format, so an XML file costs the same as other text with the same word count. Repetitions are discounted, and when you upload a newer version only new and changed strings are billed. Start with a 15-day free trial with 15,000 Smartwords and no credit card, then book a demo for volume pricing.

Can I automate recurring XML translations?

Yes. A typical Smartcat pipeline has four steps: your build exports the XML file, a script sends it to the Smartcat REST API as an update to the existing document, Smartcat translates the new and changed strings, and the next job downloads the translated files. The CLI runs the same steps from CI/CD. Book a demo to set up API access for your workspace.

Didn’t find your answer? Talk to a localization specialist

Sources

  1. W3C. Extensible Markup Language (XML) 1.0 (Fifth Edition). www.w3.org/TR/xml

  2. W3C. XML Path Language (XPath) Version 1.0. www.w3.org/TR/xpath-10

  3. Android Developers. String resources. developer.android.com/guide/topics/resources/string-resource

  4. OASIS. Darwin Information Typing Architecture (DITA) Version 1.3. docs.oasis-open.org/dita/dita/v1.3/dita-v1.3-part0-overview.html

  5. Smartcat Help Center. Use flexible XML parsing methods. help.smartcat.com/flexible-xml-parsing-methods

  6. Smartcat Help Center. Update a project. help.smartcat.com/update-a-project

Send well-formed XML to every market

See Smartcat translate one of your own XML exports with the markup untouched, or start a 15-day free trial with 15,000 Smartwords and no credit card.