Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

å in xml file is valid or not?

Tags:

xml

diacritics

IE doesn't like the å character in an XML file to display. Is that an IE problem or are å and alike chars indeed invalid XML and do i have to create the &#xxx; values for all these letters?

Michel

by the way: the chars are inside a CDATA tag

The declaration is this: hmm, can't seem to get the xml declaration pasted in my post, it gets deleted or hidden in the html of my post i think, tried the backtick, 4 spaces etc to mark it as code. However, it's the same as sais in the answers

The declaration is this:

<?xml version="1.0" encoding="utf-8"?>

The snippet is

<resource key="erroraspx-errorDescription" value="cdata">  
<![CDATA[Något gick fel. Klicka <a href=".">här</a> för att gå till webbsidan ]]>  
</resource>  
like image 471
Michel Avatar asked Sep 28 '09 08:09

Michel


People also ask

What characters are invalid in XML?

Note that the ampersand (&) and less-than (<) characters are not permitted in XML attribute values. Since XFDL computes appear in a compute attribute, these must be escaped with character or entity references (e.g. the entity references &amp; for the ampersand and &lt; for the less-than character).

Does XML accept special characters?

XML escape characters There are only five: " &quot; ' &apos; < &lt; > &gt; & &amp; Escaping characters depends on where the special character is used. The examples can be validated at the W3C Markup Validation Service.

How do I find an invalid character in XML?

If you're unable to identify this character visually, then you can use a text editor such as TextPad to view your source file. Within the application, use the Find function and select "hex" and search for the character mentioned. Removing these characters from your source file resolve the invalid XML character issue.


2 Answers

I am pretty sure that this is an encoding problem. You need to check that the encoding of your file is indeed something internationalised, like UTF-8, and that the xml header indicates this.

The xml file should start with <?xml version="1.0" encoding="UTF-8"?>

like image 142
UberAlex Avatar answered Sep 23 '22 23:09

UberAlex


I would think that would depend on the character set/encoding you had defined for the XML file.

like image 26
phoebus Avatar answered Sep 22 '22 23:09

phoebus