BUG: Word disables XML support for some documents with custom schema

I

Ignoramus

Hi,

I've attached my custom schema to a document, added some tags, and
saved the document. The next time I open the file, I receive the
following message:

"Word has disabled XML support for this document because it detected
that your computer has become unstable. To correct this problem, it is
recommended that you close all applications and restart your computer".

After I click OK on that message box, Word still displays the XML tags,
but behaves like it does when the schema is not found (doesn't attempt
to validate the XML).

I've noticed that the problem happens only when I create an invalid XML
by inserting any tag inside a tag of type "xsd:ID".

For example, the problem occurs when I enter the following XML in my
document:

<root><id><branch></branch></id></root>

Below is the custom schema I'm using. Note that the <branch> tag
violates the schema, but I used to think that Word should indicate it
with the pink line, not throw me exceptions like above. I'd like to
clarify if this is a bug or I'm doing something wrong.

I'm using MS Office Word 2003 (11.6359.6360) SP1.

Thanks!

The schema is:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="myns"
targetNamespace="myns" elementFormDefault="qualified">

<xsd:element name="root" type="Root" />

<xsd:complexType name="Root" mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="id" type="xsd:ID"/>
<xsd:element name="caption" type="xsd:string"/>
<xsd:element name="branch" type="Branch"/>
<xsd:element name="leaf" type="Leaf"/>
<xsd:any namespace="##other" />
</xsd:choice>
</xsd:complexType>

<xsd:complexType name="Branch" mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="id" type="xsd:ID"/>
<xsd:element name="caption" type="xsd:string"/>
<xsd:element name="branch" type="Branch"/>
<xsd:element name="leaf" type="Leaf"/>
<xsd:any namespace="##other" />
</xsd:choice>
</xsd:complexType>

<xsd:complexType name="Leaf" mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="id" type="xsd:ID"/>
<xsd:element name="caption" type="xsd:string"/>
<xsd:any namespace="##other" />
</xsd:choice>
</xsd:complexType>

</xsd:schema>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top