Fix: "Schema Is Non-Deterministic" Error Message Should Specify the XPath Location of the Failing
Schema Definition
The following generic XML validation error message:
Schema is non-deterministic
has been enhanced in MSXML
4.0 SP2 to report the XPath location of the non-deterministic type definition
in an XML schema. For additional information about
non-deterministic XML schemas, click the following article number to view the
article in the Microsoft Knowledge Base:
316297
PRB: "Schema Is Non-Deterministic" Error Message When You Add XSD to XMLSchemaCache Object
back to the
topFix: ServerXMLHTTP Validation Failures When You Use Extended Characters in User Names
In MSXML 4.0 RTM and Service Pack 1 (SP1), the following
authentication error is reported when you use
ServerXmlHttp to execute HTTP requests by supplying a valid user name that
contains extended characters:
Error message: HTTP 401.1 -
Unauthorized: Logon Failed
This problem has been fixed in MSXML 4.0
SP2. For additional information about this problem in MSXML
4.0, click the following article number to view the article in the Microsoft
Knowledge Base:
316594
ServerXMLHTTP Validation Failures When You Use Extended Characters in User Names
back to the
topFix: XSD Validation Does Not
Enforce Restriction Defined on a Base SimpleType
In MSXML 4.0 RTM and SP1, the XML schema validator does not
enforce restrictions that are defined on base
simpleTypes.
Validating the data in the following sample XML
document
Restriction.xml against the sample schema
Restriction.xsd does not raise any errors in MSMXL 4.0 RTM and SP1 even though
the value of the
AlphaTestValue element contains a character (the '
-' character) that is restricted by the AlphaType base
simpleType:
Restriction.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified">
<xsd:element name="AlphaTestValue" type="AlphaTypeMaxLength6"/>
<xsd:simpleType name="AlphaType">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z]*"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="AlphaTypeMaxLength6">
<xsd:restriction base="AlphaType">
<xsd:maxLength value="6"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Restriction.xml:
<?xml version="1.0"?>
<AlphaTestValue>ABCDE-</AlphaTestValue>
In MSXML 4.0 SP2, a fix has been implemented to enforce restrictions
defined on base
simpleTypes when validating XML data. This is a breaking change that has been
implemented to enhance compliancy with the World Wide Web Consortium (W3C) XML
Schema specification. XML data that violates restrictions defined on base
simpleTypes fail validation in MSXML 4.0 SP2.
back to the topFix: DOM: SetAttribute() Should Raise Error When Attribute Value Contains Invalid XML
Characters
The
IXMLDOMElement.setAttribute() method has been fixed to generate an error when a specified
attribute value contains invalid XML characters.
The following are
the valid XML characters and character ranges (hexadecimal values) as defined
by the W3C XML language specifications 1.0.:
#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
[#x10000-#x10FFFF]
This is a breaking change that has been implemented to enhance
compliancy with the W3C XML specification. You receive a runtime error message
after you upgrade to MSXML 4.0 SP2 if you have code that uses the
setAttribute DOM API method to assign values that contain invalid XML
characters to XML attributes. To resolve this, you must change your code so
that you do not use invalid XML characters in attribute values.
back to the topFix: IXMLDOMNode.attributes Does
Not Return All Default Attributes
In MSXML 4.0 RTM and SP1, using the following loop:
For Each <IXMLDOMAttributeObj> In <IXMLDOMNodeObj.attributes>.Next
to enumerate the returned
IXMLDOMNamedNodeMap collection object, does not return all the default attributes
that are defined for an XML element. Only the first default attribute is
returned, and the following error is raised when the code in the enumeration
loop tries to access the second default attribute:
Unspecified Error
This problem can be reproduced in MSXML
4.0 RTM and SP1 by executing the following Visual Basic code to parse the
attributes of the
<employee> element in the sample Employee.xml document that follows:
Dim doc As MSXML2.DOMDocument40
Set doc = New MSXML2.DOMDocument40
doc.Load "c:\Employees.xml"
Dim EmployeeAtt As IXMLDOMAttribute
For Each EmployeeAtt In doc.selectSingleNode("/employees/employee").Attributes
Debug.Print EmployeeAtt.xml
Next
Employes.xml:
<!DOCTYPE employees [
<!ELEMENT employees (employee+)>
<!ELEMENT employee EMPTY>
<!ATTLIST employee
name CDATA #REQUIRED
dept CDATA 'IT'
location CDATA 'FL'
>
]>
<employees>
<employee name='John'/>
</employees>
This problem has been fixed in MSXML 4.0 SP2. You can use the following
loop:
For Each <IXMLDOMAttributeObj> In <IXMLDOMNodeObj.attributes>.Next
to enumerate the returned
IXMLDOMNamedNodeMap, and to access all the default attributes that are defined for an
element.
back to the
topFix: Circular Strong References
Between Anonymous Types and Their Parent ComplexType Type May Cause Memory
Leak
The following XSD schema outlines the basis of the problem:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="myComplexType1">
<xs:choice>
<xs:element name="myComplexType2">
<xs:complexType>
<xs:complexContent>
<xs:extension base="myComplexType1" />
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:schema>
In this schema, the
complexContent element "
myComplexType2," extends its parent "
myComplexType1." This produces a circular strong reference between local element
declarations and their local types. Schemas like this cause a memory leak in
MSXML 4.0 RTM and SP1 that has been fixed in MSXML 4.0 SP2.
back to the top