Mobile menu

DTD for XML file with HTML entities
Thread poster: xxxkichwa
English to Italian
Apr 26, 2008

I need to create a DTD for a file which contains some XML code with HTML entities in it (see below). I need this DTD to let me translate the text between the tags "value" and "comment", but it should also recognize the HTML tags in it. The problem is that the HTML tags are delimited by the HTML entities &l-t; and &g-t; and not by the symbols < and >. Trados does not interpret those tags as HTML tags but simply displays them as editable text.

If I open the following text with Trados using the DTD I created, the text between the tags "value" and "comment" is translatable but so is the content of the "input" tag and which should be protected. Is there any way to tell Trados to treat &l-t; and &g-t; as < and >, and therefore consider those as HTML tags?

I used LESSTHAN and GREATERTHAN to represent the symbols < and > and I intentionally put a hyphen in the HTML entities.

LESSTHANdata name="ButtonEnter" xml:space="preserve"GREATERTHAN
LESSTHANdata name="ButtonSend" xml:space="preserve"GREATERTHAN
LESSTHANdata name="CancelStateUnsuccessful" xml:space="preserve"GREATERTHAN
LESSTHANvalueGREATERTHANNon è stato possibile cancellare il servizio indicato, si prega di contattare il call center.LESSTHAN/valueGREATERTHAN
LESSTHANdata name="HotelNoResults" xml:space="preserve"GREATERTHAN
LESSTHANvalueGREATERTHANNessun hotel disponibile trovato.&l-t;br /&g-t; &l-t;input type="button" value="Indietro" class="pulsante1" id="cerca" onclick="javascript:location.href='ricerca_hotel.aspx?action=back'" /&g-t; LESSTHAN/valueGREATERTHAN


Direct link Reply with quote

tectranslate ITS GmbH
Local time: 05:15
+ ...
Ouch Apr 26, 2008

Try replacing all occurrences of &lt; with <htmlxlate and all occurrences of &gt; with dummyattribute="here">. This should encapsulate the HTML stuff in a new element called htmlxlate.

If necessary, generate a new settings file, then translate. After translation, revert the above replacements (the dummyattribute="here" thing is to make sure you don't damage the XML tags inadvertently).

Can't try it right now, so there's no guarantee this'll work. You may have to fiddle around with it a bit in case the HTML elements with attributes act up (they're probably not valid while you have the htmlxlate element in there).


P.S.: Whoops, messed up the tags at first. Fixed.

[Edited at 2008-04-26 10:28]

Direct link Reply with quote
English to Italian
Thanks Apr 26, 2008

Thanks Benjamin,
I'll try that out later this afternoon. However, I think I see one problem with what you suggest: I assume that the "value" inside the "input" tag will not be translatable as it should be (and as it is using a regular HTML4 DTD setting in trados). I'll try that and see if it does work or not.

Direct link Reply with quote

To report site rules violations or get help, contact a site moderator:

You can also contact site staff by submitting a support request »

DTD for XML file with HTML entities

Advanced search

Translation news related to SDL Trados PDF Translation
Fast and Reliable PDF Translation - reduce your workload while maintaining quality

Unlock the potential of PDFs, taking your original PDF, replacing the text with your translations from your preferred tools and in minutes, get a high quality, ready-to-use, translated PDF. Try it now - your first 50 pages are free.

More info »
PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »

All of
  • All of
  • Term search
  • Jobs