Microsoft KB Archive/826753

= BUG: The minLength attribute in an XML Schema is not validated when an attribute or element value is set to empty or null in a XML string =

Article ID: 826753

Article Last Modified on 1/17/2007

-

APPLIES TO


 * Microsoft XML Core Services 4.0
 * Microsoft XML Core Services 4.0 Service Pack 1
 * Microsoft XML Core Services 4.0
 * Microsoft XML Parser 3.0 Service Pack 3
 * Microsoft XML Parser 3.0 Service Pack 2
 * Microsoft XML Parser 3.0 Service Pack 1
 * Microsoft XML Core Services 4.0
 * Microsoft XML Parser 2.6
 * Microsoft XML Parser 2.5
 * Microsoft XML Parser 2.0

-





SYMPTOMS
You set an element or attribute value to empty or to null in an XML file. When you validate the contents of an XML string with an XML schema that specifies the minLength attribute as greater than zero, XML validation does not occur, and the parser error does not occur.



CAUSE
The World Wide Web Consortium (W3C) schema specification has a method to validate content that is set to empty or null. XML-Data Reduced (XDR) schema does not have this method. XDR does not validate elements or attribute values that are null or empty, and makes a choice about validation. Therefore, XDR does not validate the minLength attribute when the value of an element or attribute in an XML string is set to empty or to null.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to reproduce the behavior
  Paste the following code in Notepad or in a text editor of your choice:     /TestXMLSchema.asp in the Address box, and then click Go. is the placeholder for the name of your Web server. Notice that XML validation does not occur for the minLength attribute, and no parser error occurs.

