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

◆ ParseAttlistType()

void System.Xml.DtdParser.ParseAttlistType ( SchemaAttDef attrDef,
SchemaElementDecl elementDecl,
bool ignoreErrors )
inlineprivate

Definition at line 629 of file DtdParser.cs.

630 {
631 Token token = GetToken(needWhiteSpace: true);
632 if (token != 0)
633 {
635 }
636 if (IsAttributeValueType(token))
637 {
640 switch (token)
641 {
642 default:
643 return;
644 case Token.ID:
645 if (_validate && elementDecl.IsIdDeclared)
646 {
647 SchemaAttDef attDef = elementDecl.GetAttDef(attrDef.Name);
648 if ((attDef == null || attDef.Datatype.TokenizedType != XmlTokenizedType.ID) && !ignoreErrors)
649 {
651 }
652 }
654 return;
655 case Token.NOTATION:
656 break;
657 }
658 if (_validate)
659 {
660 if (elementDecl.IsNotationDeclared && !ignoreErrors)
661 {
663 }
664 else
665 {
666 if (elementDecl.ContentValidator != null && elementDecl.ContentValidator.ContentType == XmlSchemaContentType.Empty && !ignoreErrors)
667 {
669 }
671 }
672 }
674 {
675 do
676 {
677 string nameString = GetNameString();
679 {
681 }
682 if (_validate && !_v1Compat && attrDef.Values != null && attrDef.Values.Contains(nameString) && !ignoreErrors)
683 {
685 }
686 attrDef.AddValue(nameString);
687 switch (GetToken(needWhiteSpace: false))
688 {
689 case Token.Or:
690 continue;
691 case Token.RightParen:
692 return;
693 }
694 break;
695 }
696 while (GetToken(needWhiteSpace: false) == Token.Name);
697 }
698 }
699 else if (token == Token.LeftParen)
700 {
703 if (GetToken(needWhiteSpace: false) == Token.Nmtoken)
704 {
705 attrDef.AddValue(GetNameString());
706 while (true)
707 {
708 string nmtokenString;
709 switch (GetToken(needWhiteSpace: false))
710 {
711 case Token.Or:
712 if (GetToken(needWhiteSpace: false) == Token.Nmtoken)
713 {
715 if (_validate && !_v1Compat && attrDef.Values != null && attrDef.Values.Contains(nmtokenString) && !ignoreErrors)
716 {
718 }
719 goto IL_0278;
720 }
721 break;
722 case Token.RightParen:
723 return;
724 }
725 break;
726 IL_0278:
727 attrDef.AddValue(nmtokenString);
728 }
729 }
730 }
732 }
bool ICollection< TValue >. Contains(TValue item)
static string Xml_AttlistDuplNotationValue
Definition SR.cs:232
static string Sch_NotationAttributeOnEmptyElement
Definition SR.cs:716
static string Sch_DupNotationAttribute
Definition SR.cs:712
static string Xml_AttlistDuplEnumValue
Definition SR.cs:230
static string Sch_IdAttrDeclared
Definition SR.cs:406
Definition SR.cs:7
void SendValidationEvent(int pos, XmlSeverityType severity, string code, string arg)
void AddUndeclaredNotation(string notationName)
bool IsAttributeValueType(Token token)
Token GetToken(bool needWhiteSpace)
SchemaInfo _schemaInfo
Definition DtdParser.cs:146
string GetNmtokenString()
Dictionary< string, SchemaNotation > Notations
static ? XmlSchemaSimpleType GetBuiltInSimpleType(XmlQualifiedName qualifiedName)

References System.Xml.DtdParser._curPos, System.Xml.DtdParser._schemaInfo, System.Xml.DtdParser._v1Compat, System.Xml.DtdParser._validate, System.Xml.DtdParser.AddUndeclaredNotation(), System.Xml.DtdParser.BaseUriStr, System.Collections.Generic.Dictionary< TKey, TValue >.ValueCollection.Contains(), System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Xml.Dictionary, System.Xml.Schema.XmlSchemaType.GetBuiltInSimpleType(), System.Xml.DtdParser.GetNameString(), System.Xml.DtdParser.GetNmtokenString(), System.Xml.DtdParser.GetToken(), System.Xml.DtdParser.IsAttributeValueType(), System.Xml.DtdParser.LineNo, System.Xml.DtdParser.LinePos, System.Xml.Schema.SchemaInfo.Notations, System.Xml.DtdParser.OnUnexpectedError(), System.SR.Sch_DupNotationAttribute, System.SR.Sch_IdAttrDeclared, System.SR.Sch_NotationAttributeOnEmptyElement, System.Xml.DtdParser.SendValidationEvent(), System.Collections.Generic.Dictionary< TKey, TValue >.Values, System.SR.Xml_AttlistDuplEnumValue, and System.SR.Xml_AttlistDuplNotationValue.

Referenced by System.Xml.DtdParser.ParseAttlistDecl().