private SetQualifiedName ( |
||
value | ||
return | void |
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); }
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); }
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); }
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); } }
} //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); } }