From: <to...@us...> - 2002-10-04 03:36:42
|
Update of /cvsroot/nantcontrib/NAntContrib/src/Tasks In directory usw-pr-cvs1:/tmp/cvs-serv13377/src/Tasks Modified Files: ValidateXmlTask.cs Log Message: Changed xmlfiles element for files (xmlfiles is invalid xml), added support for FailOnError to ValidateXml task. Index: ValidateXmlTask.cs =================================================================== RCS file: /cvsroot/nantcontrib/NAntContrib/src/Tasks/ValidateXmlTask.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ValidateXmlTask.cs 3 Oct 2002 03:14:56 -0000 1.2 --- ValidateXmlTask.cs 4 Oct 2002 03:36:39 -0000 1.3 *************** *** 48,51 **** --- 48,54 ---- /// string, then the system will use the targetNamespace attribute /// of the underlying schema to associate it with a namespace. + /// + /// You can use the failonerror attribute of the task to control + /// whether a validation failure will stop the build or not. /// </remarks> /// <example> *************** *** 56,62 **** /// <schemaref namespace="urn:schemas-company-com:base" source="base-schema.xsd"/> /// </schemas> ! /// <xmlfiles> /// <includes name="*.xml"/> ! /// </xmlfiles> /// </validatexml> /// ]]></code> --- 59,65 ---- /// <schemaref namespace="urn:schemas-company-com:base" source="base-schema.xsd"/> /// </schemas> ! /// <files> /// <includes name="*.xml"/> ! /// </files> /// </validatexml> /// ]]></code> *************** *** 72,76 **** /// Set of XML files to use as input /// </summary> ! [FileSet("xmlfiles", Required=true)] public FileSet XmlFiles { get { return _xmlFiles; } --- 75,79 ---- /// Set of XML files to use as input /// </summary> ! [FileSet("files", Required=true)] public FileSet XmlFiles { get { return _xmlFiles; } *************** *** 118,122 **** Log.WriteLine(LogPrefix + "Document is valid"); } else { ! Log.WriteLine(LogPrefix + _numErrors + " Errors in document"); } } --- 121,130 ---- Log.WriteLine(LogPrefix + "Document is valid"); } else { ! if ( !FailOnError ) { ! Log.WriteLine(LogPrefix + _numErrors + " Errors in document"); ! } else { ! string msg = string.Format("Invalid XML Document '{0}'", file); ! throw new BuildException(msg, Location); ! } } } |