How do I define entities for the author mode ?

Questions about XML that are not covered by the other forums should go here.
amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

How do I define entities for the author mode ?

Post by amix » Thu Nov 29, 2007 5:26 am

I want to represent German umlauts as in HTML (ie: Ä ü etc.). How can I do this ?
When I add the <!ENTITY> element to an XML document after the XML prolog, it gets marked as error. I also do not understand, how exactly I should do this entity declaration, ie, how it looks like. Thanks.
Andreas

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Thu Nov 29, 2007 11:46 am

Hello,

Just declare them as character entities:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY Auml '&#196;'>
<!ENTITY uuml '&#252;'>
]>
<root>
The &Auml; and &uuml; characters.
</root>
You can also use the character codes directly:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<root>
The &#196; and &#252; characters.
</root>
Regards,
Sorin

amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

Post by amix » Fri Nov 30, 2007 12:31 am

Thanks Sorin. This explains my mistake. I put a & and quotes around the first argument to the entitiy declaration and left out the <!DOCTYPE> element.
Andreas

Post Reply