XmlValidationStepEx bug in release 3.0.1032.0 Nov 30 2008

Apr 8, 2009 at 6:56 AM
I found a bug in the ExecuteValidation method where the IList object may not be instantiated before calling a method on it.  To fix it, I added the code within the comment lines below:


 

public void ExecuteValidation(Stream data, XmlNode validatorConfig, Context context)
{
    this.xmlSchemaPath = context.ReadConfigAsString( validatorConfig, "XmlSchemaPath", true );
    
this.xmlSchemaNameSpace = context.ReadConfigAsString( validatorConfig, "XmlSchemaNameSpace", true );
    
XmlNodeList xpaths = validatorConfig.SelectNodes( "XPathList/*" );

 

 

    foreach( XmlNode xpath in xpaths)
    {
        
string xpathExp = xpath.SelectSingleNode("@query").Value;
        
string expectedValue = xpath.SelectSingleNode(".").InnerText;

 

 

        //////////////////////////////////////////////////////////////
        
//DMT: New code to instantiate IList if it doesn't exist yet
        
if (this.xPathValidations == null)
        {
            
Type listType = Type.GetType("System.Collections.Generic.IList`1[System.Web.UI.Pair]");
            
this.xPathValidations = new List<Pair>(); 
        
}
        
//////////////////////////////////////////////////////////////

 

 

        this.xPathValidations.Add(new Pair(xpathExp, expectedValue));
    }

 

    ExecuteValidation(data, context);
}

Coordinator
May 25, 2009 at 8:35 PM

Thanks, I'll update this and get it in the next release,

 

cheers,

 

Kevin

Coordinator
Jun 5, 2009 at 7:35 PM

This is fixed in v3.1,

 

thanks,

 

Kevin