本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}