Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InferSchema1()

XmlSchemaSet System.Xml.Schema.XmlSchemaInference.InferSchema1 ( XmlReader instanceDocument,
XmlSchemaSet schemas )
inlinepackage

Definition at line 123 of file XmlSchemaInference.cs.

124 {
125 if (instanceDocument == null)
126 {
127 throw new ArgumentNullException("instanceDocument");
128 }
129 _rootSchema = null;
131 schemas.Compile();
132 _schemaSet = schemas;
133 while (_xtr.NodeType != XmlNodeType.Element && _xtr.Read())
134 {
135 }
136 if (_xtr.NodeType == XmlNodeType.Element)
137 {
139 if (_xtr.NamespaceURI == "http://www.w3.org/2001/XMLSchema")
140 {
141 throw new XmlSchemaInferenceException(System.SR.SchInf_schema, 0, 0);
142 }
143 XmlSchemaElement xse = null;
144 foreach (XmlSchemaElement value in schemas.GlobalElements.Values)
145 {
146 if (value.Name == _xtr.LocalName && value.QualifiedName.Namespace == _xtr.NamespaceURI)
147 {
148 _rootSchema = value.Parent as XmlSchema;
149 xse = value;
150 break;
151 }
152 }
153 if (_rootSchema == null)
154 {
156 }
157 else
158 {
160 }
161 foreach (string item in _namespaceManager)
162 {
163 if (!item.Equals("xml") && !item.Equals("xmlns"))
164 {
166 if (text2.Length != 0)
167 {
169 }
170 }
171 }
172 schemas.Reprocess(_rootSchema);
173 schemas.Compile();
174 return schemas;
175 }
176 throw new XmlSchemaInferenceException(System.SR.SchInf_NoElement, 0, 0);
177 }
static string SchInf_NoElement
Definition SR.cs:1230
static string SchInf_schema
Definition SR.cs:1208
Definition SR.cs:7
override? string Get(string value)
Definition NameTable.cs:79
void InferElement(XmlSchemaElement xse, bool bCreatingNewType, XmlSchema parentSchema)
XmlSchemaElement AddElement(string localName, string prefix, string childURI, XmlSchema parentSchema, XmlSchemaObjectCollection addLocation, int positionWithinCollection)
readonly XmlNamespaceManager _namespaceManager
XmlSerializerNamespaces Namespaces
virtual ? string LookupNamespace(string prefix)
XmlNodeType NodeType
Definition XmlReader.cs:62

References System.Xml.Schema.XmlSchemaInference._namespaceManager, System.Xml.Schema.XmlSchemaInference._nametable, System.Xml.Schema.XmlSchemaInference._rootSchema, System.Xml.Schema.XmlSchemaInference._schemaSet, System.Xml.Schema.XmlSchemaInference._targetNamespace, System.Xml.Schema.XmlSchemaInference._xtr, System.Xml.Schema.XmlSchemaInference.AddElement(), System.Xml.Schema.XmlSchemaSet.Compile(), System.Xml.Dictionary, System.Xml.NameTable.Get(), System.Xml.Schema.XmlSchemaSet.GlobalElements, System.Xml.Schema.XmlSchemaInference.InferElement(), System.item, System.Xml.XmlReader.LocalName, System.Xml.XmlNamespaceManager.LookupNamespace(), System.Xml.Schema.XmlSchemaObject.Namespaces, System.Xml.XmlReader.NamespaceURI, System.Xml.XmlReader.NodeType, System.Xml.XmlReader.Prefix, System.Xml.XmlReader.Read(), System.Xml.Schema.XmlSchemaSet.Reprocess(), System.SR.SchInf_NoElement, System.SR.SchInf_schema, System.value, and System.Xml.Schema.XmlSchemaObjectTable.Values.

Referenced by System.Xml.Schema.XmlSchemaInference.InferSchema(), and System.Xml.Schema.XmlSchemaInference.InferSchema().