FIX: MSXML 3.0 Cannot Parse DTD NMTOKEN Values with More than One Colon (315358)



The information in this article applies to:

  • Microsoft XML 3.0 SP2

This article was previously published under Q315358

SYMPTOMS

When you try to use MSXML 3.0 to validate an XML file against a Document Type Definition (DTD), and the data contains an NMTOKEN attribute with more than one colon (:) character, you may receive the following error message:
-1072897501 Validate failed because the document does not contain exactly one root node.

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next MSXML service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:
   Date         Version      Size             File name
   -----------------------------------------------------
   20-Dec-2001  8.20.9220.0  1,105,408 bytes  Msxml3.dll
   20-Dec-2001  8.20.9220.0     24,576 bytes  Msxml3a.dll
   20-Dec-2001  8.20.9220.0     44,032 bytes  Msxml3r.dll

				

STATUS

Microsoft has confirmed that this is a problem in MSXML 3.0 Service Pack 2.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Create the following DTD file, and then name the file Nmtoken.dtd:
    <!ELEMENT datatype (desc)>
    <!ELEMENT desc (#PCDATA)>
    <!ATTLIST desc
       att NMTOKEN #REQUIRED
    >
    					
  2. Create the following XML file, and then name the file Nmtoken.xml:
    <?xml version="1.0"?>
    <!DOCTYPE datatype SYSTEM "nmtoken.dtd">
    <datatype>
       <desc att="a:b:c">abc</desc>
    </datatype>
    					
  3. Paste the following Microsoft Visual Basic Scripting Edition (VBScript) code in Notepad, and then save the text file as Nmtoken.vbs:
    Dim oDoc
    Dim oErr
    
    Set oDoc = CreateObject("MSXML2.DOMDocument.3.0")
    oDoc.load "nmtoken.xml"
    oDoc.async = False
    
    Set oErr = oDoc.validate
    If oErr.errorCode <> 0 Then
       WScript.Echo oErr.errorCode & " " & oErr.reason
    End If
    					
  4. Double-click the Nmtoken.vbs file to run the VBScript code.

Modification Type:MinorLast Reviewed:10/12/2005
Keywords:kbHotfixServer kbQFE kbbug kbfix kbQFE KB315358