• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Schema.XmlSchemaComplexType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Xml.Schema.XmlSchemaComplexType的典型用法代码示例。如果您正苦于以下问题:C# System.Xml.Schema.XmlSchemaComplexType类的具体用法?C# System.Xml.Schema.XmlSchemaComplexType怎么用?C# System.Xml.Schema.XmlSchemaComplexType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



System.Xml.Schema.XmlSchemaComplexType类属于命名空间,在下文中一共展示了System.Xml.Schema.XmlSchemaComplexType类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetTypedTableSchema

 public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) {
     System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
     System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
     IBDataset ds = new IBDataset();
     xs.Add(ds.GetSchemaSerializable());
     System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "SPR_TOVDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     return type;
 }
开发者ID:vpjulia,项目名称:Salvia,代码行数:27,代码来源:IBDataset.Designer.cs


示例2: GetTypedDataSetSchema

 public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) {
     IBDataset ds = new IBDataset();
     System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
     System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
     xs.Add(ds.GetSchemaSerializable());
     System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     return type;
 }
开发者ID:vpjulia,项目名称:Salvia,代码行数:11,代码来源:IBDataset.Designer.cs


示例3: GetTypedDataSetSchema

 public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) {
     NorthwindDataSet ds = new NorthwindDataSet();
     System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
     System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
     xs.Add(ds.GetSchemaSerializable());
     if (PublishLegacyWSDL()) {
         System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
         any.Namespace = ds.Namespace;
         sequence.Items.Add(any);
     }
     else {
         System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
         any1.Namespace = "http://www.w3.org/2001/XMLSchema";
         any1.MinOccurs = new decimal(0);
         any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
         sequence.Items.Add(any1);
         System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
         any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
         any2.MinOccurs = new decimal(0);
         any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
         sequence.Items.Add(any2);
         sequence.MaxOccurs = decimal.MaxValue;
         System.Xml.Schema.XmlSchemaAttribute attribute = new System.Xml.Schema.XmlSchemaAttribute();
         attribute.Name = "namespace";
         attribute.FixedValue = ds.Namespace;
         type.Attributes.Add(attribute);
     }
     type.Particle = sequence;
     return type;
 }
开发者ID:BackupTheBerlios,项目名称:mbunit-svn,代码行数:30,代码来源:NorthwindDataSet.Designer.cs


示例4: AssessCloseStartElementLocallyValidComplexType

		// 3.4.4 Element Locally Valid (Complex Type)
		// FIXME: use SchemaInfo for somewhere (? it is passed to ValidateEndOfAttributes() for some reason)
		private void AssessCloseStartElementLocallyValidComplexType (ComplexType cType, XmlSchemaInfo info)
		{
			// 1.
			if (cType.IsAbstract) {
				HandleError ("Target complex type is abstract.");
				return;
			}

			// 2 (xsi:nil and content prohibition)
			// See AssessStartElementSchemaValidity() and ValidateCharacters()
			// 3. attribute uses and  5. wild IDs are handled at
			// ValidateAttribute(), except for default/fixed values.

			// Collect default attributes.
			// 4.
			foreach (XsAttribute attr in GetExpectedAttributes ()) {
				if (attr.ValidatedUse == XmlSchemaUse.Required && 
					attr.ValidatedFixedValue == null)
					HandleError ("Required attribute " + attr.QualifiedName + " was not found.");
				else if (attr.ValidatedDefaultValue != null || attr.ValidatedFixedValue != null)
					defaultAttributesCache.Add (attr);
			}
			if (defaultAttributesCache.Count == 0)
				defaultAttributes = emptyAttributeArray;
			else
				defaultAttributes = (XsAttribute []) 
					defaultAttributesCache.ToArray (
						typeof (XsAttribute));
			defaultAttributesCache.Clear ();
			// 5. wild IDs was already checked at ValidateAttribute().

			// 3. - handle default attributes
#region ID Constraints
			if (!IgnoreIdentity) {
				foreach (XsAttribute a in defaultAttributes) {
					var atype = a.AttributeType as XmlSchemaDatatype ?? a.AttributeSchemaType.Datatype;
					object avalue = a.ValidatedFixedValue ?? a.ValidatedDefaultValue;
					string error = idManager.AssessEachAttributeIdentityConstraint (atype, avalue, ((QName) elementQNameStack [elementQNameStack.Count - 1]).Name);
					if (error != null)
						HandleError (error);
				}
			}
#endregion

#region Key Constraints
			if (!IgnoreIdentity)
				foreach (XsAttribute a in defaultAttributes)
					ValidateKeyFieldsAttribute (a, a.ValidatedFixedValue ?? a.ValidatedDefaultValue);
#endregion
		}
开发者ID:zxlin25,项目名称:mono,代码行数:52,代码来源:XmlSchemaValidator.cs



注:本文中的System.Xml.Schema.XmlSchemaComplexType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Schema.XmlSchemaSequence类代码示例发布时间:2022-05-24
下一篇:
C# Schema.XmlSchemaAttribute类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap