本文整理汇总了C#中System.Xml.Schema.XmlSchemaObject.error方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaObject.error方法的具体用法?C# XmlSchemaObject.error怎么用?C# XmlSchemaObject.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchemaObject
的用法示例。
在下文中一共展示了XmlSchemaObject.error方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToTable
public static void AddToTable (XmlSchemaObjectTable table, XmlSchemaObject obj,
XmlQualifiedName qname, ValidationEventHandler h)
{
if (table.Contains (qname)) {
// FIXME: This logic unexpectedly allows
// one redefining item and two or more redefining items.
// FIXME: redefining item is not simple replacement,
// but much more complex stuff.
if (obj.isRedefineChild) { // take precedence.
if (obj.redefinedObject != null)
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
else
obj.redefinedObject = table [qname];
table.Set (qname, obj);
}
else if (table [qname].isRedefineChild) {
if (table [qname].redefinedObject != null)
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
else
table [qname].redefinedObject = obj;
return; // never add to the table.
}
else if (StrictMsCompliant) {
table.Set (qname, obj);
}
else
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table. {1}",
qname, "Consider setting MONO_STRICT_MS_COMPLIANT to 'yes' to mimic MS implementation."));
}
else
table.Set (qname, obj);
}
示例2: CompileID
public static void CompileID (string id, XmlSchemaObject xso, Hashtable idCollection, ValidationEventHandler h)
{
//check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#ID
// 1. ID must be a NCName
// 2. ID must be unique in the schema
if(id == null)
return;
if(!CheckNCName(id))
xso.error(h,id+" is not a valid id attribute");
else if(idCollection.ContainsKey(id))
xso.error(h,"Duplicate id attribute "+id);
else
idCollection.Add(id,xso);
}