DTD for XML file with HTML entities
Thread poster: kichwa (X)

kichwa (X)
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



tectranslate ITS GmbH
Local time: 10:01
+ ...
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]


kichwa (X)
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.


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

Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »
SDL Trados Studio 2019 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2019 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2019 transforms how new users get up and running, helps experienced users make the most of the powerful features, ensures new

More info »

  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search