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

◆ AddDefaultAttributesAndNormalize()

void System.Xml.XmlTextReaderImpl.AddDefaultAttributesAndNormalize ( )
inlineprivate

Definition at line 4362 of file XmlTextReaderImpl.cs.

4363 {
4365 if (dtdAttributeListInfo == null)
4366 {
4367 return;
4368 }
4369 if (_normalize && dtdAttributeListInfo.HasNonCDataAttributes)
4370 {
4371 for (int i = _index + 1; i < _index + 1 + _attrCount; i++)
4372 {
4373 NodeData nodeData = _nodes[i];
4374 IDtdAttributeInfo dtdAttributeInfo = dtdAttributeListInfo.LookupAttribute(nodeData.prefix, nodeData.localName);
4375 if (dtdAttributeInfo == null || !dtdAttributeInfo.IsNonCDataType)
4376 {
4377 continue;
4378 }
4379 if (DtdValidation && _standalone && dtdAttributeInfo.IsDeclaredInExternal)
4380 {
4381 string stringValue = nodeData.StringValue;
4382 nodeData.TrimSpacesInValue();
4383 if (stringValue != nodeData.StringValue)
4384 {
4386 }
4387 }
4388 else
4389 {
4390 nodeData.TrimSpacesInValue();
4391 }
4392 }
4393 }
4395 if (enumerable == null)
4396 {
4397 return;
4398 }
4399 int attrCount = _attrCount;
4400 NodeData[] array = null;
4401 if (_attrCount >= 250)
4402 {
4403 array = new NodeData[_attrCount];
4404 Array.Copy(_nodes, _index + 1, array, 0, _attrCount);
4405 object[] array2 = array;
4406 Array.Sort(array2, DtdDefaultAttributeInfoToNodeDataComparer.Instance);
4407 }
4408 foreach (IDtdDefaultAttributeInfo item in enumerable)
4409 {
4410 if (AddDefaultAttributeDtd(item, definedInDtd: true, array) && DtdValidation && _standalone && item.IsDeclaredInExternal)
4411 {
4412 string prefix = item.Prefix;
4413 string arg = ((prefix.Length == 0) ? item.LocalName : (prefix + ":" + item.LocalName));
4415 }
4416 }
4418 {
4421 }
4422 }
static string Sch_UnSpecifiedDefaultAttributeInExternalStandalone
Definition SR.cs:400
static string Sch_StandAloneNormalization
Definition SR.cs:398
Definition SR.cs:7
void SendValidationEvent(XmlSeverityType severity, string code, string arg, int lineNo, int linePos)
bool AddDefaultAttributeDtd(IDtdDefaultAttributeInfo defAttrInfo, bool definedInDtd, NodeData[] nameSortedNodeData)
IDtdAttributeListInfo LookupAttributeList(string prefix, string localName)

References System.Xml.XmlTextReaderImpl._attrCount, System.Xml.XmlTextReaderImpl._attrNeedNamespaceLookup, System.Xml.XmlTextReaderImpl._curNode, System.Xml.XmlTextReaderImpl._dtdInfo, System.Xml.XmlTextReaderImpl._index, System.Xml.XmlTextReaderImpl._nameTable, System.Xml.XmlTextReaderImpl._nodes, System.Xml.XmlTextReaderImpl._normalize, System.Xml.XmlTextReaderImpl._standalone, System.Xml.XmlTextReaderImpl.AddDefaultAttributeDtd(), System.array, System.Xml.XmlTextReaderImpl.AttributeNamespaceLookup(), System.Array.Copy(), System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.DtdDefaultAttributeInfoToNodeDataComparer.Instance, System.item, System.Xml.XmlTextReaderImpl.NodeData.LineNo, System.Xml.XmlTextReaderImpl.NodeData.LinePos, System.Xml.XmlTextReaderImpl.NodeData.localName, System.Xml.IDtdInfo.LookupAttributeList(), System.prefix, System.Xml.XmlTextReaderImpl.NodeData.prefix, System.SR.Sch_StandAloneNormalization, System.SR.Sch_UnSpecifiedDefaultAttributeInExternalStandalone, System.Xml.XmlTextReaderImpl.SendValidationEvent(), and System.Array.Sort().

Referenced by System.Xml.XmlTextReaderImpl.ParseAttributes(), System.Xml.XmlTextReaderImpl.ParseAttributesAsync(), System.Xml.XmlTextReaderImpl.ParseElement(), and System.Xml.XmlTextReaderImpl.ParseElementAsync_NoAttributes().