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

◆ InternalParseNodeTest()

static void System.Xml.Xsl.XPath.XPathParser< Node >.InternalParseNodeTest ( XPathScanner scanner,
XPathAxis axis,
out XPathNodeType nodeType,
out string nodePrefix,
out string nodeName )
inlinestaticpackage

Definition at line 195 of file XPathParser.cs.

196 {
197 switch (scanner.Kind)
198 {
199 case LexKind.Name:
200 if (scanner.CanBeFunction && IsNodeType(scanner))
201 {
202 nodePrefix = null;
203 nodeName = null;
204 switch (scanner.Name)
205 {
206 case "comment":
207 nodeType = XPathNodeType.Comment;
208 break;
209 case "text":
210 nodeType = XPathNodeType.Text;
211 break;
212 case "node":
213 nodeType = XPathNodeType.All;
214 break;
215 default:
216 nodeType = XPathNodeType.ProcessingInstruction;
217 break;
218 }
219 scanner.NextLex();
220 scanner.PassToken(LexKind.LParens);
221 if (nodeType == XPathNodeType.ProcessingInstruction && scanner.Kind != LexKind.RParens)
222 {
223 scanner.CheckToken(LexKind.String);
224 nodePrefix = string.Empty;
225 nodeName = scanner.StringValue;
226 scanner.NextLex();
227 }
228 scanner.PassToken(LexKind.RParens);
229 }
230 else
231 {
232 nodePrefix = scanner.Prefix;
233 nodeName = scanner.Name;
234 nodeType = PrincipalNodeType(axis);
235 scanner.NextLex();
236 if (nodeName == "*")
237 {
238 nodeName = null;
239 }
240 }
241 break;
242 case LexKind.Star:
243 nodePrefix = null;
244 nodeName = null;
245 nodeType = PrincipalNodeType(axis);
246 scanner.NextLex();
247 break;
248 default:
249 throw scanner.CreateException(System.SR.XPath_NodeTestExpected, scanner.RawValue);
250 }
251 }
static string XPath_NodeTestExpected
Definition SR.cs:1834
Definition SR.cs:7
static bool IsNodeType(XPathScanner scanner)
static XPathNodeType PrincipalNodeType(XPathAxis axis)

References System.Xml.Xsl.XPath.XPathParser< Node >.IsNodeType(), System.Xml.Xsl.XPath.XPathParser< Node >.PrincipalNodeType(), and System.SR.XPath_NodeTestExpected.

Referenced by System.Xml.Xsl.XPath.XPathParser< Node >.ParseNodeTest().