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

◆ CheckNamespaceInScope()

bool System.Xml.Xsl.IlGen.XmlILNamespaceAnalyzer.CheckNamespaceInScope ( QilBinary nd)
inlineprivate

Definition at line 92 of file XmlILNamespaceAnalyzer.cs.

93 {
94 QilNodeType nodeType = nd.NodeType;
96 string text;
97 string text2;
98 if ((uint)(nodeType - 81) <= 1u)
99 {
101 if (!(qilName != null))
102 {
103 return false;
104 }
106 text2 = qilName.NamespaceUri;
107 nodeKind = ((nd.NodeType == QilNodeType.ElementCtor) ? XPathNodeType.Element : XPathNodeType.Attribute);
108 }
109 else
110 {
111 text = (QilLiteral)nd.Left;
112 text2 = (QilLiteral)nd.Right;
113 nodeKind = XPathNodeType.Namespace;
114 }
115 if ((nd.NodeType == QilNodeType.AttributeCtor && text2.Length == 0) || (text == "xml" && text2 == "http://www.w3.org/XML/1998/namespace"))
116 {
117 XmlILConstructInfo.Write(nd).IsNamespaceInScope = true;
118 return true;
119 }
120 if (!ValidateNames.ValidateName(text, string.Empty, text2, nodeKind, ValidateNames.Flags.CheckPrefixMapping))
121 {
122 return false;
123 }
126 for (int i = 0; i < _cntNmsp; i++)
127 {
129 if ((object)text == prefix)
130 {
131 if ((object)text2 == uri)
132 {
133 XmlILConstructInfo.Write(nd).IsNamespaceInScope = true;
134 }
135 break;
136 }
137 }
138 if (_addInScopeNmsp)
139 {
141 _cntNmsp++;
142 }
143 return true;
144 }
string Add(char[] array, int offset, int length)
bool GetNamespaceDeclaration(int idx, [NotNullWhen(true)] out string prefix, out string uri)
virtual void AddNamespace(string prefix, string uri)

References System.Xml.Xsl.IlGen.XmlILNamespaceAnalyzer._addInScopeNmsp, System.Xml.Xsl.IlGen.XmlILNamespaceAnalyzer._cntNmsp, System.Xml.Xsl.IlGen.XmlILNamespaceAnalyzer._nsmgr, System.Xml.XmlNameTable.Add(), System.Xml.XmlNamespaceManager.AddNamespace(), System.Xml.Dictionary, System.Xml.XmlNamespaceManager.GetNamespaceDeclaration(), System.Xml.XmlNamespaceManager.NameTable, System.prefix, System.Xml.Xsl.Qil.QilName.Prefix, System.text, System.Xml.ValidateNames.ValidateName(), and System.Xml.Xsl.IlGen.XmlILConstructInfo.Write().

Referenced by System.Xml.Xsl.IlGen.XmlILNamespaceAnalyzer.AnalyzeContent().