System\Xml\Schema\ContentValidator.cs (23)
42private readonly Dictionary<XmlQualifiedName, int> _names;
50_names = new Dictionary<XmlQualifiedName, int>();
72public int AddName(XmlQualifiedName name, object? particle)
135foreach (KeyValuePair<XmlQualifiedName, int> entry in _names)
137XmlQualifiedName name = entry.Key;
139if (name != XmlQualifiedName.Empty && list.Allows(name))
167public int this[XmlQualifiedName name]
188public bool Exists(XmlQualifiedName name) => _names.ContainsKey(name);
203foreach (KeyValuePair<XmlQualifiedName, int> name in _names)
982public virtual object? ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
1065public override object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
1120public bool Exists(XmlQualifiedName name)
1129public void AddName(XmlQualifiedName name, object? particle)
1251LeafNode endMarker = new LeafNode(_positions!.Add(_symbols!.AddName(XmlQualifiedName.Empty, null), null));
1587public override object? ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
1710public override object? ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
1869public override object? ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
2113private readonly Dictionary<XmlQualifiedName, int> _elements; // unique terminal names to positions in Bitset mapping
2120_elements = new Dictionary<XmlQualifiedName, int>(size);
2125public bool AddElement(XmlQualifiedName name, object particle, bool isEmptiable)
2154public override object? ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
2197foreach (KeyValuePair<XmlQualifiedName, int> element in _elements)
2212foreach (KeyValuePair<XmlQualifiedName, int> element in _elements)
System\Xml\Schema\Inference\Infer.cs (27)
18internal static readonly XmlQualifiedName ST_boolean = new XmlQualifiedName("boolean", XmlSchema.Namespace);
19internal static readonly XmlQualifiedName ST_byte = new XmlQualifiedName("byte", XmlSchema.Namespace);
20internal static readonly XmlQualifiedName ST_unsignedByte = new XmlQualifiedName("unsignedByte", XmlSchema.Namespace);
21internal static readonly XmlQualifiedName ST_short = new XmlQualifiedName("short", XmlSchema.Namespace);
22internal static readonly XmlQualifiedName ST_unsignedShort = new XmlQualifiedName("unsignedShort", XmlSchema.Namespace);
23internal static readonly XmlQualifiedName ST_int = new XmlQualifiedName("int", XmlSchema.Namespace);
24internal static readonly XmlQualifiedName ST_unsignedInt = new XmlQualifiedName("unsignedInt", XmlSchema.Namespace);
25internal static readonly XmlQualifiedName ST_long = new XmlQualifiedName("long", XmlSchema.Namespace);
26internal static readonly XmlQualifiedName ST_unsignedLong = new XmlQualifiedName("unsignedLong", XmlSchema.Namespace);
27internal static readonly XmlQualifiedName ST_integer = new XmlQualifiedName("integer", XmlSchema.Namespace);
28internal static readonly XmlQualifiedName ST_decimal = new XmlQualifiedName("decimal", XmlSchema.Namespace);
29internal static readonly XmlQualifiedName ST_float = new XmlQualifiedName("float", XmlSchema.Namespace);
30internal static readonly XmlQualifiedName ST_double = new XmlQualifiedName("double", XmlSchema.Namespace);
31internal static readonly XmlQualifiedName ST_duration = new XmlQualifiedName("duration", XmlSchema.Namespace);
32internal static readonly XmlQualifiedName ST_dateTime = new XmlQualifiedName("dateTime", XmlSchema.Namespace);
33internal static readonly XmlQualifiedName ST_time = new XmlQualifiedName("time", XmlSchema.Namespace);
34internal static readonly XmlQualifiedName ST_date = new XmlQualifiedName("date", XmlSchema.Namespace);
35internal static readonly XmlQualifiedName ST_gYearMonth = new XmlQualifiedName("gYearMonth", XmlSchema.Namespace);
36internal static readonly XmlQualifiedName ST_string = new XmlQualifiedName("string", XmlSchema.Namespace);
37internal static readonly XmlQualifiedName ST_anySimpleType = new XmlQualifiedName("anySimpleType", XmlSchema.Namespace);
39internal static XmlQualifiedName[] SimpleTypes =
891XmlQualifiedName qname = new XmlQualifiedName(_xtr.LocalName, _xtr.NamespaceURI);
908xse.SchemaTypeName = XmlQualifiedName.Empty;
1008else if (elem.SchemaTypeName != XmlQualifiedName.Empty)
1250xse.SchemaTypeName = XmlQualifiedName.Empty; //re-set the name
1446internal XmlQualifiedName RefineSimpleType(string s, ref int iTypeFlags)
2419private static int GetSchemaType(XmlQualifiedName qname)
System\Xml\Schema\SchemaInfo.cs (33)
27private readonly Dictionary<XmlQualifiedName, SchemaElementDecl> _elementDecls = new Dictionary<XmlQualifiedName, SchemaElementDecl>();
28private readonly Dictionary<XmlQualifiedName, SchemaElementDecl> _undeclaredElementDecls = new Dictionary<XmlQualifiedName, SchemaElementDecl>();
30private Dictionary<XmlQualifiedName, SchemaEntity>? _generalEntities;
31private Dictionary<XmlQualifiedName, SchemaEntity>? _parameterEntities;
33private XmlQualifiedName _docTypeName = XmlQualifiedName.Empty;
39private readonly Dictionary<XmlQualifiedName, SchemaAttDef> _attributeDecls = new Dictionary<XmlQualifiedName, SchemaAttDef>();
42private readonly Dictionary<XmlQualifiedName, SchemaElementDecl> _elementDeclsByType = new Dictionary<XmlQualifiedName, SchemaElementDecl>();
51public XmlQualifiedName DocTypeName
63internal Dictionary<XmlQualifiedName, SchemaElementDecl> ElementDecls
68internal Dictionary<XmlQualifiedName, SchemaElementDecl> UndeclaredElementDecls
73internal Dictionary<XmlQualifiedName, SchemaEntity> GeneralEntities =>
74_generalEntities ??= new Dictionary<XmlQualifiedName, SchemaEntity>();
76internal Dictionary<XmlQualifiedName, SchemaEntity> ParameterEntities =>
77_parameterEntities ??= new Dictionary<XmlQualifiedName, SchemaEntity>();
90internal Dictionary<XmlQualifiedName, SchemaElementDecl> ElementDeclsByType
95internal Dictionary<XmlQualifiedName, SchemaAttDef> AttributeDecls
109internal SchemaElementDecl? GetElementDecl(XmlQualifiedName qname)
120internal SchemaElementDecl? GetTypeDecl(XmlQualifiedName qname)
132internal XmlSchemaElement? GetElement(XmlQualifiedName qname)
153internal SchemaAttDef? GetAttributeXdr(SchemaElementDecl? ed, XmlQualifiedName qname)
176internal SchemaAttDef? GetAttributeXsd(SchemaElementDecl? ed, XmlQualifiedName qname, XmlSchemaObject? partialValidationType, out AttributeMatchState attributeMatchState)
257internal SchemaAttDef? GetAttributeXsd(SchemaElementDecl? ed, XmlQualifiedName qname, ref bool skip)
305foreach (KeyValuePair<XmlQualifiedName, SchemaElementDecl> entry in sinfo._elementDecls)
312foreach (KeyValuePair<XmlQualifiedName, SchemaElementDecl> entry in sinfo._elementDeclsByType)
331Dictionary<XmlQualifiedName, SchemaElementDecl> elements = _elementDecls;
370XmlQualifiedName qname = new XmlQualifiedName(prefix, localName);
394XmlQualifiedName qname = new XmlQualifiedName(name);
403XmlQualifiedName IDtdInfo.Name
System\Xml\Schema\XdrBuilder.cs (43)
51internal XmlQualifiedName _Name;
53internal XmlQualifiedName _TypeName;
75_Name = XmlQualifiedName.Empty;
77_TypeName = XmlQualifiedName.Empty;
147internal XmlQualifiedName? _Name;
424XmlQualifiedName qname = new XmlQualifiedName(name, XmlSchemaDatatype.XdrCanonizeUri(ns, _NameTable, _SchemaNames));
438SendValidationEvent(SR.Sch_UnsupportedElement, XmlQualifiedName.ToString(name, prefix));
448XmlQualifiedName qname = new XmlQualifiedName(name, XmlSchemaDatatype.XdrCanonizeUri(ns, _NameTable, _SchemaNames));
458XmlQualifiedName qnameValue = XmlQualifiedName.Parse(value, _CurNsMgr, out prefixValue);
495XmlQualifiedName.ToString(qname.Name, prefix));
671XmlQualifiedName gname = builder._UndefinedAttributeTypes._TypeName;
697builder.SendValidationEvent(SR.Sch_UndeclaredElement, XmlQualifiedName.ToString(ed!.Name.Name, ed.Prefix));
729XmlQualifiedName qname = (XmlQualifiedName)obj;
733builder.SendValidationEvent(SR.Sch_DupElementDecl, XmlQualifiedName.ToString(qname.Name, prefix));
747builder._ElementDef._ContentAttr = builder.GetContent((XmlQualifiedName)obj);
752builder._contentValidator!.IsOpen = builder.GetModel((XmlQualifiedName)obj);
757builder._ElementDef._OrderAttr = builder._GroupDef._Order = builder.GetOrder((XmlQualifiedName)obj);
916XmlQualifiedName pName = patt._TypeName;
1012ad._AttDef = new SchemaAttDef(XmlQualifiedName.Empty, null);
1032XmlQualifiedName qname = (XmlQualifiedName)obj;
1046builder.SendValidationEvent(SR.Sch_DupAttribute, XmlQualifiedName.ToString(qname.Name, prefix));
1056builder.SendValidationEvent(SR.Sch_DupAttribute, XmlQualifiedName.ToString(qname.Name, prefix));
1073XmlQualifiedName qname = (XmlQualifiedName)obj;
1181XmlQualifiedName qname = (XmlQualifiedName)obj;
1246builder._BaseDecl!._TypeName = (XmlQualifiedName)obj;
1271XmlQualifiedName qname = builder._BaseDecl._TypeName;
1286XmlQualifiedName gname = qname;
1297builder.SendValidationEvent(SR.Sch_UndeclaredAttribute, XmlQualifiedName.ToString(qname.Name, prefix));
1361builder._GroupDef._Order = builder.GetOrder((XmlQualifiedName)obj);
1487private bool GetNextState(XmlQualifiedName qname)
1504private bool IsSkipableElement(XmlQualifiedName qname)
1518private bool IsSkipableAttribute(XmlQualifiedName qname)
1543private int GetOrder(XmlQualifiedName qname)
1586XmlQualifiedName qname = (XmlQualifiedName)obj;
1719private int GetContent(XmlQualifiedName qname)
1748private bool GetModel(XmlQualifiedName qname)
1774XmlQualifiedName.ToString(_ElementDef._ElementDecl.Name.Name, _ElementDef._ElementDecl.Prefix));
System\Xml\Schema\XmlSchemaValidator.cs (22)
97private XmlQualifiedName _contextQName;
210Push(XmlQualifiedName.Empty);
405XmlQualifiedName elementName = _contextQName;
515XmlQualifiedName attQName = new XmlQualifiedName(localName, namespaceUri);
1305private object? ValidateElementContext(XmlQualifiedName elementName, out bool invalidElementInContext)
1309XmlQualifiedName head;
1388private XmlSchemaElement? GetSubstitutionGroupHead(XmlQualifiedName member)
1393XmlQualifiedName head = memberElem.SubstitutionGroup;
1522private void Push(XmlQualifiedName elementName)
1590private SchemaElementDecl? FastGetElementDecl(XmlQualifiedName elementName, object? particle)
1643XmlQualifiedName xsiTypeName = XmlQualifiedName.Empty;
1654xsiTypeName = (typedVal as XmlQualifiedName)!;
1779private SchemaAttDef? CheckIsXmlAttribute(XmlQualifiedName attQName)
2099Dictionary<XmlQualifiedName, SchemaAttDef> attributeDefs = currentElementDecl.AttDefs;
2123xsiElement.SchemaTypeName = XmlQualifiedName.Empty; //Reset typeName on element as this might be different
2510internal static void ElementValidationError(XmlQualifiedName name, ValidationState context, ValidationEventHandler? eventHandler, object sender, string? sourceUri, int lineNo, int linePos, XmlSchemaSet? schemaSet)
2614XmlQualifiedName currentQName;
2673XmlQualifiedName name = (expected[0] as XmlQualifiedName)!;
2700name = (expected[i] as XmlQualifiedName)!;
2761internal static string BuildElementName(XmlQualifiedName qname)
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (4)
395WriteQualifiedNameElement(name, ns!, element.Default, (XmlQualifiedName)o!, element.IsNullable, mapping.IsSoap, mapping);
477private void WriteQualifiedNameElement(string name, string ns, object? defaultValue, XmlQualifiedName o, bool nullable, bool isSoap, PrimitiveMapping mapping)
957XmlQualifiedName? xmlQualifiedName = null;
1108stringValue = FromXmlQualifiedName((XmlQualifiedName?)o);
System\Xml\Serialization\Types.cs (7)
504AddPrimitive(typeof(XmlQualifiedName), "QName", "XmlQualifiedName", TypeFlags.CanBeAttributeValue | TypeFlags.HasCustomFormatter | TypeFlags.HasIsEmpty | TypeFlags.CanBeElementValue | TypeFlags.XmlEncodingNotRequired | TypeFlags.Reference);
571if (type == typeof(XmlQualifiedName))
605AddSoapEncodedPrimitive(typeof(XmlQualifiedName), "QName", ns, "XmlQualifiedName", new XmlQualifiedName("string", XmlSchema.Namespace), TypeFlags.CanBeAttributeValue | TypeFlags.HasCustomFormatter | TypeFlags.HasIsEmpty | TypeFlags.CanBeElementValue | TypeFlags.XmlEncodingNotRequired | TypeFlags.Reference);
639private static void AddNonXsdPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, XmlSchemaFacet[] facets, TypeFlags flags)
657private static void AddSoapEncodedPrimitive(Type type, string dataTypeName, string ns, string formatterName, XmlQualifiedName baseTypeName, TypeFlags flags)
818else if (type == typeof(XmlQualifiedName))
1365internal static XmlQualifiedName ParseWsdlArrayType(string type, out string dims, XmlSchemaObject? parent)
System\Xml\Serialization\XmlSchemaImporter.cs (28)
31public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type? baseType)
52public XmlTypeMapping ImportDerivedTypeMapping(XmlQualifiedName name, Type? baseType, bool baseTypeCanBeIndirect)
79public XmlTypeMapping ImportSchemaType(XmlQualifiedName typeName)
86public XmlTypeMapping ImportSchemaType(XmlQualifiedName typeName, Type? baseType)
93public XmlTypeMapping ImportSchemaType(XmlQualifiedName typeName, Type? baseType, bool baseTypeCanBeIndirect)
132public XmlTypeMapping ImportTypeMapping(XmlQualifiedName name)
139public XmlMembersMapping ImportMembersMapping(XmlQualifiedName name)
146public XmlMembersMapping? ImportAnyType(XmlQualifiedName typeName, string elementName)
187public XmlMembersMapping ImportMembersMapping(XmlQualifiedName[] names)
194public XmlMembersMapping ImportMembersMapping(XmlQualifiedName[] names, Type? baseType, bool baseTypeCanBeIndirect)
201XmlQualifiedName name = names[i];
249private ElementAccessor ImportElement(XmlQualifiedName name, Type desiredMappingType, Type? baseType)
284XmlQualifiedName parentType = XmlSchemas.GetParentName(element);
377XmlQualifiedName qname = new XmlQualifiedName(typeName, ns);
393internal override void ImportDerivedTypes(XmlQualifiedName baseName)
415private TypeMapping? ImportType(XmlQualifiedName name, Type desiredMappingType, Type? baseType, TypeFlags flags, bool addref)
632internal XmlQualifiedName? baseSimpleType;
672XmlQualifiedName groupName = ((XmlSchemaAttributeGroupRef)item).RefName;
1114private void ImportTextMember(CodeIdentifiers members, CodeIdentifiers membersScope, XmlQualifiedName? simpleContentType)
1588private AttributeAccessor ImportSpecialAttribute(XmlQualifiedName name)
1855private XmlSchemaGroup FindGroup(XmlQualifiedName name)
1864private XmlSchemaAttributeGroup FindAttributeGroup(XmlQualifiedName name)
1873internal static XmlQualifiedName BaseTypeName(XmlSchemaSimpleType dataType)
1901XmlQualifiedName qname = BaseTypeName(dataType);
1911private XmlSchemaSimpleType? FindDataType(XmlQualifiedName? name, TypeFlags flags)
1946private XmlSchemaType? FindType(XmlQualifiedName? name, TypeFlags flags)
1962private XmlSchemaElement FindElement(XmlQualifiedName name)
1970private XmlSchemaAttribute FindAttribute(XmlQualifiedName name)
System\Xml\Serialization\XmlSerializationWriter.cs (37)
96XmlQualifiedName[] qnames = (XmlQualifiedName[])value.ToArray(typeof(XmlQualifiedName));
188private XmlQualifiedName GetPrimitiveTypeName(Type type)
194private XmlQualifiedName? GetPrimitiveTypeName(Type type, bool throwIfUnknown)
196XmlQualifiedName? qname = GetPrimitiveTypeNameInternal(type);
202internal static XmlQualifiedName? GetPrimitiveTypeNameInternal(Type type)
228if (type == typeof(XmlQualifiedName)) typeName = "QName";
335if (t == typeof(XmlQualifiedName))
345value = FromXmlQualifiedName((XmlQualifiedName)o, false);
459protected string? FromXmlQualifiedName(XmlQualifiedName? xmlQualifiedName)
464protected string? FromXmlQualifiedName(XmlQualifiedName? xmlQualifiedName, bool ignoreEmpty)
537foreach (XmlQualifiedName qname in _namespaces.Namespaces)
569foreach (XmlQualifiedName qname in nsList.Namespaces)
688protected void WriteNullableStringEncoded(string name, string? ns, string? value, XmlQualifiedName? xsiType)
705protected void WriteNullableStringEncodedRaw(string name, string? ns, string? value, XmlQualifiedName? xsiType)
713protected void WriteNullableStringEncodedRaw(string name, string? ns, byte[]? value, XmlQualifiedName? xsiType)
740protected void WriteNullableQualifiedNameEncoded(string name, string? ns, XmlQualifiedName? value, XmlQualifiedName? xsiType)
751protected void WriteNullableQualifiedNameLiteral(string name, string? ns, XmlQualifiedName? value)
935XmlQualifiedName qname = TypeScope.ParseWsdlArrayType(attr.Value, out dims, (container is XmlSchemaObject) ? (XmlSchemaObject)container : null);
1063protected void WriteElementString(string localName, string? value, XmlQualifiedName? xsiType)
1068protected void WriteElementString(string localName, string? ns, string? value, XmlQualifiedName? xsiType)
1102protected void WriteElementStringRaw(string localName, string? value, XmlQualifiedName? xsiType)
1107protected void WriteElementStringRaw(string localName, byte[]? value, XmlQualifiedName? xsiType)
1112protected void WriteElementStringRaw(string localName, string? ns, string? value, XmlQualifiedName? xsiType)
1122protected void WriteElementStringRaw(string localName, string? ns, byte[]? value, XmlQualifiedName? xsiType)
1141protected void WriteElementQualifiedName(string localName, XmlQualifiedName? value)
1146protected void WriteElementQualifiedName(string localName, XmlQualifiedName? value, XmlQualifiedName? xsiType)
1154protected void WriteElementQualifiedName(string localName, string? ns, XmlQualifiedName? value)
1159protected void WriteElementQualifiedName(string localName, string? ns, XmlQualifiedName? value, XmlQualifiedName? xsiType)
1217XmlQualifiedName? qualName = GetPrimitiveTypeName(elementType, false);
1246XmlQualifiedName qualName = GetPrimitiveTypeName(elementType);
1337if (Type.GetTypeCode(t) == TypeCode.Object && !(o is Guid) && (t != typeof(XmlQualifiedName)) && !(o is XmlNode[]) && (t != typeof(byte[])))
1439foreach (XmlQualifiedName qname in xmlns.Namespaces)