Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Umlaut in XML

From: Peter Flynn <peter.nosp@-.--------.-->
To: NULL
Date: 12/1/2008 12:17:00 AM
Waldy wrote:
> I am trying to use this in a standard .Net configuration file.  Hi The 
> encoding is declared at the top of the file as utf-8. 

Just saying that the file is encoded in UTF-8 doesn't mean that it is.
Like putting a label on your toothpaste tube that says "Tomato puree" 
doesn't make it tomato puree. The file has to BE in UTF-8.

> I get an XML 
> exception when I use the umlaut, "Invalid character in the given encoding". 

That indicates that the file is not in UTF-8.

> If I change it to &auml; I get the error "Reference to undeclared entity".

Correct. If you want to use named character entity references you must 
declare them in a DTD or an internal subset, eg

<?xml version="1.0"?>
<!DOCTYPE whatever [
<!ENTITY uuml "&#228;">
]>

> I have however tried using &#228; again and it works!  

Yes, numeric references work everywhere.

> I don't know what happened the first time, but thanks anyway. 

Check the encoding of the file. If it's not UTF-8, use iconv or whatever 
the equivalent is in Windows to convert it. If you can't convert it, 
change the encoding declaration to say what is really being used (eg 
ISO8859-1). Leaving it broken will cause subsequent users problems.

///Peter
-- 
XML FAQ: http://xml.silmaril.ie/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent