Microsoft KB Archive/825769

= XML is not validated when you call the InsertXML property in a newly created Word document =

Article ID: 825769

Article Last Modified on 4/13/2007

-

APPLIES TO


 * Microsoft Office Word 2007
 * Microsoft Office Word 2003

-





SYMPTOMS
In Microsoft Office Word 2007 or in Microsoft Office Word 2003, when you insert an XML schema in a newly created document by calling the InsertXML property, and by using the XML from the current document, the inserted XML is not validated.



CAUSE
This problem occurs because the XML validation is called, but it quits because the Schema Object Model (SOM) has not yet been validated. If you call the XMLSchemaReferences.Validate method, the problem is not resolved because this method just instantiates another validation pass and does not make sure that the SOM has been validated.



WORKAROUND
To work around this problem, use one of the following methods.

Method 1: Attach the XML Schema Before Calling InsertXML
Always attach all schemas that are used in the XML that you want to insert before you call the InsertXML property.

Method 2: Validate After You Call the InsertXML Property
After you call the InsertXML property, perform the following two calls to validate the XML: i = ActiveDocument.XMLNodes(1).ChildNodeSuggestions.Count activedocument.XMLSchemaReferences.Validate



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Additional query words: wd2003 wd2007

Keywords: kbxml kbbug kbpending KB825769

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.