当前位置: 首页>>代码示例>>C#>>正文


C# XmlSchemaAttribute.SetQualifiedName方法代码示例

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


在下文中一共展示了XmlSchemaAttribute.SetQualifiedName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PreprocessAttribute

 private void PreprocessAttribute(XmlSchemaAttribute attribute)
 {
     if (attribute.Name != null)
     {
         this.ValidateNameAttribute(attribute);
         attribute.SetQualifiedName(new XmlQualifiedName(attribute.Name, this.targetNamespace));
     }
     else
     {
         base.SendValidationEvent("Sch_MissRequiredAttribute", "name", attribute);
     }
     if (attribute.Use != XmlSchemaUse.None)
     {
         base.SendValidationEvent("Sch_ForbiddenAttribute", "use", attribute);
     }
     if (attribute.Form != XmlSchemaForm.None)
     {
         base.SendValidationEvent("Sch_ForbiddenAttribute", "form", attribute);
     }
     this.PreprocessAttributeContent(attribute);
     this.ValidateIdAttribute(attribute);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:Preprocessor.cs

示例2: PreprocessLocalAttribute

 private void PreprocessLocalAttribute(XmlSchemaAttribute attribute)
 {
     if (attribute.Name != null)
     {
         this.ValidateNameAttribute(attribute);
         this.PreprocessAttributeContent(attribute);
         attribute.SetQualifiedName(new XmlQualifiedName(attribute.Name, ((attribute.Form == XmlSchemaForm.Qualified) || ((attribute.Form == XmlSchemaForm.None) && (this.attributeFormDefault == XmlSchemaForm.Qualified))) ? this.targetNamespace : null));
     }
     else
     {
         this.PreprocessAnnotation(attribute);
         if (attribute.RefName.IsEmpty)
         {
             base.SendValidationEvent("Sch_AttributeNameRef", "???", attribute);
         }
         else
         {
             this.ValidateQNameAttribute(attribute, "ref", attribute.RefName);
         }
         if ((!attribute.SchemaTypeName.IsEmpty || (attribute.SchemaType != null)) || (attribute.Form != XmlSchemaForm.None))
         {
             base.SendValidationEvent("Sch_InvalidAttributeRef", attribute);
         }
         attribute.SetQualifiedName(attribute.RefName);
     }
     this.ValidateIdAttribute(attribute);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:Preprocessor.cs

示例3: PreprocessLocalAttribute

 private void PreprocessLocalAttribute(XmlSchemaAttribute attribute) {
     if (attribute.Name != null) { // name
         ValidateNameAttribute(attribute);
         PreprocessAttributeContent(attribute);
         attribute.SetQualifiedName(new XmlQualifiedName(attribute.Name, (attribute.Form == XmlSchemaForm.Qualified || (attribute.Form == XmlSchemaForm.None && this.attributeFormDefault == XmlSchemaForm.Qualified)) ? this.targetNamespace : null));
     } 
     else { // ref
         PreprocessAnnotation(attribute); //set parent of annotation child of ref
         if (attribute.RefName.IsEmpty) {
             SendValidationEvent(Res.Sch_AttributeNameRef, "???", attribute);
         }
         else {
             ValidateQNameAttribute(attribute, "ref", attribute.RefName);
         }
         if (!attribute.SchemaTypeName.IsEmpty || 
             attribute.SchemaType != null || 
             attribute.Form != XmlSchemaForm.None /*||
             attribute.DefaultValue != null ||
             attribute.FixedValue != null*/
         ) {
             SendValidationEvent(Res.Sch_InvalidAttributeRef, attribute);
         }
         attribute.SetQualifiedName(attribute.RefName);
     }
     ValidateIdAttribute(attribute);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:26,代码来源:Preprocessor.cs

示例4: BuildXsiAttributes

 private static void BuildXsiAttributes()
 {
     if (xsiTypeSO == null)
     {
         XmlSchemaAttribute attribute = new XmlSchemaAttribute {
             Name = "type"
         };
         attribute.SetQualifiedName(new XmlQualifiedName("type", "http://www.w3.org/2001/XMLSchema-instance"));
         attribute.SetAttributeType(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.QName));
         Interlocked.CompareExchange<XmlSchemaAttribute>(ref xsiTypeSO, attribute, null);
     }
     if (xsiNilSO == null)
     {
         XmlSchemaAttribute attribute2 = new XmlSchemaAttribute {
             Name = "nil"
         };
         attribute2.SetQualifiedName(new XmlQualifiedName("nil", "http://www.w3.org/2001/XMLSchema-instance"));
         attribute2.SetAttributeType(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean));
         Interlocked.CompareExchange<XmlSchemaAttribute>(ref xsiNilSO, attribute2, null);
     }
     if (xsiSLSO == null)
     {
         XmlSchemaSimpleType builtInSimpleType = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String);
         XmlSchemaAttribute attribute3 = new XmlSchemaAttribute {
             Name = "schemaLocation"
         };
         attribute3.SetQualifiedName(new XmlQualifiedName("schemaLocation", "http://www.w3.org/2001/XMLSchema-instance"));
         attribute3.SetAttributeType(builtInSimpleType);
         Interlocked.CompareExchange<XmlSchemaAttribute>(ref xsiSLSO, attribute3, null);
     }
     if (xsiNoNsSLSO == null)
     {
         XmlSchemaSimpleType type2 = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String);
         XmlSchemaAttribute attribute4 = new XmlSchemaAttribute {
             Name = "noNamespaceSchemaLocation"
         };
         attribute4.SetQualifiedName(new XmlQualifiedName("noNamespaceSchemaLocation", "http://www.w3.org/2001/XMLSchema-instance"));
         attribute4.SetAttributeType(type2);
         Interlocked.CompareExchange<XmlSchemaAttribute>(ref xsiNoNsSLSO, attribute4, null);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:41,代码来源:XmlSchemaValidator.cs

示例5: BuildXsiAttributes

          } //End of method

        private static void BuildXsiAttributes() {
            if (xsiTypeSO == null) { //xsi:type attribute
                XmlSchemaAttribute tempXsiTypeSO = new XmlSchemaAttribute();
                tempXsiTypeSO.Name = "type";
                tempXsiTypeSO.SetQualifiedName(new XmlQualifiedName("type", XmlReservedNs.NsXsi));
                tempXsiTypeSO.SetAttributeType(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.QName));
                Interlocked.CompareExchange<XmlSchemaAttribute>(ref xsiTypeSO, tempXsiTypeSO, null);
            }
            if (xsiNilSO == null) { //xsi:nil
                XmlSchemaAttribute tempxsiNilSO = new XmlSchemaAttribute();
                tempxsiNilSO.Name = "nil";
                tempxsiNilSO.SetQualifiedName(new XmlQualifiedName("nil", XmlReservedNs.NsXsi));
                tempxsiNilSO.SetAttributeType(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Boolean));
                Interlocked.CompareExchange<XmlSchemaAttribute>(ref xsiNilSO, tempxsiNilSO, null);
            }
            if (xsiSLSO == null) { //xsi:schemaLocation
                XmlSchemaSimpleType stringType = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String);
                XmlSchemaAttribute tempxsiSLSO = new XmlSchemaAttribute();
                tempxsiSLSO.Name = "schemaLocation";
                tempxsiSLSO.SetQualifiedName(new XmlQualifiedName("schemaLocation", XmlReservedNs.NsXsi));
                tempxsiSLSO.SetAttributeType(stringType);
                Interlocked.CompareExchange<XmlSchemaAttribute>(ref xsiSLSO, tempxsiSLSO, null);
            }
            if (xsiNoNsSLSO == null) {
                XmlSchemaSimpleType stringType = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String);
                XmlSchemaAttribute tempxsiNoNsSLSO = new XmlSchemaAttribute();
                tempxsiNoNsSLSO.Name = "noNamespaceSchemaLocation";
                tempxsiNoNsSLSO.SetQualifiedName(new XmlQualifiedName("noNamespaceSchemaLocation", XmlReservedNs.NsXsi));
                tempxsiNoNsSLSO.SetAttributeType(stringType);
                Interlocked.CompareExchange<XmlSchemaAttribute>(ref xsiNoNsSLSO, tempxsiNoNsSLSO, null);
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:34,代码来源:XmlSchemaValidator.cs


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