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

◆ LoadDocumentType()

void System.Xml.XmlLoader.LoadDocumentType ( IDtdInfo dtdInfo,
XmlDocumentType dtNode )
inlineprivate

Definition at line 507 of file XmlLoader.cs.

508 {
509 if (!(dtdInfo is SchemaInfo schemaInfo))
510 {
511 throw new XmlException(System.SR.Xml_InternalError, string.Empty);
512 }
513 dtNode.DtdSchemaInfo = schemaInfo;
514 if (schemaInfo == null)
515 {
516 return;
517 }
518 _doc.DtdSchemaInfo = schemaInfo;
519 if (schemaInfo.Notations != null)
520 {
521 foreach (SchemaNotation value3 in schemaInfo.Notations.Values)
522 {
523 dtNode.Notations.SetNamedItem(new XmlNotation(value3.Name.Name, value3.Pubid, value3.SystemLiteral, _doc));
524 }
525 }
526 if (schemaInfo.GeneralEntities != null)
527 {
528 foreach (SchemaEntity value4 in schemaInfo.GeneralEntities.Values)
529 {
530 XmlEntity xmlEntity = new XmlEntity(value4.Name.Name, value4.Text, value4.Pubid, value4.Url, value4.NData.IsEmpty ? null : value4.NData.Name, _doc);
531 xmlEntity.SetBaseURI(value4.DeclaredURI);
532 dtNode.Entities.SetNamedItem(xmlEntity);
533 }
534 }
535 if (schemaInfo.ParameterEntities != null)
536 {
537 foreach (SchemaEntity value5 in schemaInfo.ParameterEntities.Values)
538 {
539 XmlEntity xmlEntity2 = new XmlEntity(value5.Name.Name, value5.Text, value5.Pubid, value5.Url, value5.NData.IsEmpty ? null : value5.NData.Name, _doc);
540 xmlEntity2.SetBaseURI(value5.DeclaredURI);
541 dtNode.Entities.SetNamedItem(xmlEntity2);
542 }
543 }
544 _doc.Entities = dtNode.Entities;
545 foreach (KeyValuePair<XmlQualifiedName, SchemaElementDecl> elementDecl in schemaInfo.ElementDecls)
546 {
548 if (value.AttDefs == null)
549 {
550 continue;
551 }
553 {
554 SchemaAttDef value2 = attDef.Value;
555 if (value2.Datatype.TokenizedType == XmlTokenizedType.ID)
556 {
557 _doc.AddIdInfo(_doc.AddXmlName(value.Prefix, value.Name.Name, string.Empty, null), _doc.AddAttrXmlName(value2.Prefix, value2.Name.Name, string.Empty, null));
558 break;
559 }
560 }
561 }
562 }
static string Xml_InternalError
Definition SR.cs:54
Definition SR.cs:7
bool AddIdInfo(XmlName eleName, XmlName attrName)
XmlName AddXmlName(string prefix, string localName, string namespaceURI, IXmlSchemaInfo schemaInfo)
XmlName AddAttrXmlName(string prefix, string localName, string namespaceURI, IXmlSchemaInfo schemaInfo)
XmlDocument _doc
Definition XmlLoader.cs:9

References System.Xml.XmlLoader._doc, System.Xml.XmlDocument.AddAttrXmlName(), System.Xml.XmlDocument.AddIdInfo(), System.Xml.XmlDocument.AddXmlName(), System.Xml.Dictionary, System.value, System.Collections.Generic.Dictionary< TKey, TValue >.Values, System.SR.Xml_InternalError, and System.Xml.XmlException.

Referenced by System.Xml.XmlLoader.LoadDocumentTypeNode(), and System.Xml.XmlLoader.ParseDocumentType().