SYMPTOMS

Validating an XML Document with MSXML gives the following error message:

0xC00CE504. A name was started with an invalid character.

STEPS TO REPRODUCE BEHAVIOR

1 - Start XMLBlueprint.

2 - Paste the following code into a new text document, and save the file as wap.xml:

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

<!DOCTYPE html SYSTEM "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

</html>

3 - Open file wap.xml and validate by clicking XML > Validate. The error message will appear in the Output Window.

CAUSE

DTD http://www.wapforum.org/DTD/xhtml-mobile10.dtd

includes http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-framework-1.mod

which includes http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-charent-1.mod

which includes http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-special.ent.

This file contains two errors:

<!ENTITY lt "&#38;&#60;" ><!-- less-than sign, U+003C ISOnum -->

<!ENTITY amp "&#38;&#38;" ><!-- ampersand, U+0026 ISOnum -->

This should have been (no '&' before '#'!):

<!ENTITY lt "&#38;#60;" ><!-- less-than sign, U+003C ISOnum -->

<!ENTITY amp "&#38;#38;" ><!-- ampersand, U+0026 ISOnum -->

The error can be avoided by using

instead of

SOLUTION

To avoid this error, change file wap.xml to:

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

<!DOCTYPE html SYSTEM "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" [

<!ENTITY % xhtml-special PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">

]>

<html xmlns="http://www.w3.org/1999/xhtml">

</html>