Search code examples
xmldoctypeadobe-indesign

replacing euro character entity with the euro symbol


I have some XML that looks like this

 <book>
  <bio>
    hello world, the &euro; is doing awfully well today
  </bio>
 </book>

Currently, when I import this to indesign, the &euro; is still showing as that, instead of displaying as €

I've tried adding it to the doctype as:

<?xml version='1.0' encoding='UTF-8' ?>
  <!DOCTYPE book [
    <!ENTITY euro '&euro;'>
  ]>
  <book>
    <bio> 

but this still renders out as &euro; instead of €. How can I get this to display as I wish?


Solution

  • You'd have to declare the entity in terms of either the literal character (if your XML file is stored in a character encoding that can represent it literally):

    <!ENTITY euro '€'>
    

    or a numeric character reference (which is safe in any ASCII-compatible encoding, including UTF-8, ISO-8859-1, ISO-8859-15, etc.)

    <!ENTITY euro '&#x20AC;'>