當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。