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

◆ CompileXPath()

void System.Xml.Schema.Asttree.CompileXPath ( string xPath,
bool isField,
XmlNamespaceManager nsmgr )
inline

Definition at line 63 of file Asttree.cs.

64 {
65 if (xPath == null || xPath.Length == 0)
66 {
67 throw new XmlSchemaException(System.SR.Sch_EmptyXPath, string.Empty);
68 }
69 string[] array = xPath.Split('|');
70 ArrayList arrayList = new ArrayList(array.Length);
71 _fAxisArray = new ArrayList(array.Length);
72 try
73 {
74 for (int i = 0; i < array.Length; i++)
75 {
77 arrayList.Add(value);
78 }
79 }
80 catch
81 {
82 throw new XmlSchemaException(System.SR.Sch_ICXpathError, xPath);
83 }
84 for (int j = 0; j < arrayList.Count; j++)
85 {
87 Axis axis2;
88 if ((axis2 = axis) == null)
89 {
90 throw new XmlSchemaException(System.SR.Sch_ICXpathError, xPath);
91 }
93 if (IsAttribute(axis2))
94 {
95 if (!isField)
96 {
97 throw new XmlSchemaException(System.SR.Sch_SelectorAttr, xPath);
98 }
100 try
101 {
102 axis2 = (Axis)axis2.Input;
103 }
104 catch
105 {
106 throw new XmlSchemaException(System.SR.Sch_ICXpathError, xPath);
107 }
108 }
109 while (axis2 != null && (IsNameTest(axis2) || IsSelf(axis2)))
110 {
111 if (IsSelf(axis2) && axis != axis2)
112 {
113 axis3.Input = axis2.Input;
114 }
115 else
116 {
117 axis3 = axis2;
118 if (IsNameTest(axis2))
119 {
121 }
122 }
123 try
124 {
125 axis2 = (Axis)axis2.Input;
126 }
127 catch
128 {
129 throw new XmlSchemaException(System.SR.Sch_ICXpathError, xPath);
130 }
131 }
132 axis3.Input = null;
133 if (axis2 == null)
134 {
135 if (IsSelf(axis) && axis.Input != null)
136 {
137 _fAxisArray.Add(new ForwardAxis(DoubleLinkAxis.ConvertTree((Axis)axis.Input), isdesorself: false));
138 }
139 else
140 {
141 _fAxisArray.Add(new ForwardAxis(DoubleLinkAxis.ConvertTree(axis), isdesorself: false));
142 }
143 continue;
144 }
146 {
147 throw new XmlSchemaException(System.SR.Sch_ICXpathError, xPath);
148 }
149 try
150 {
151 axis2 = (Axis)axis2.Input;
152 }
153 catch
154 {
155 throw new XmlSchemaException(System.SR.Sch_ICXpathError, xPath);
156 }
157 if (axis2 == null || !IsSelf(axis2) || axis2.Input != null)
158 {
159 throw new XmlSchemaException(System.SR.Sch_ICXpathError, xPath);
160 }
161 if (IsSelf(axis) && axis.Input != null)
162 {
163 _fAxisArray.Add(new ForwardAxis(DoubleLinkAxis.ConvertTree((Axis)axis.Input), isdesorself: true));
164 }
165 else
166 {
167 _fAxisArray.Add(new ForwardAxis(DoubleLinkAxis.ConvertTree(axis), isdesorself: true));
168 }
169 }
170 }
virtual int Add(object? value)
static string Sch_EmptyXPath
Definition SR.cs:728
static string Sch_ICXpathError
Definition SR.cs:734
static string Sch_SelectorAttr
Definition SR.cs:736
Definition SR.cs:7
static bool IsAttribute(Axis ast)
Definition Asttree.cs:36
static bool IsDescendantOrSelf(Axis ast)
Definition Asttree.cs:45
static bool IsSelf(Axis ast)
Definition Asttree.cs:54
static bool IsNameTest(Axis ast)
Definition Asttree.cs:27
void SetURN(Axis axis, XmlNamespaceManager nsmgr)
Definition Asttree.cs:172
static AstNode ParseXPathExpression(string xpathExpression)

References System.Xml.Schema.Asttree._fAxisArray, System.Collections.ArrayList.Add(), System.array, System.Xml.Schema.DoubleLinkAxis.ConvertTree(), System.Xml.Dictionary, System.Xml.Schema.Asttree.IsAttribute(), System.Xml.Schema.Asttree.IsDescendantOrSelf(), System.Xml.Schema.Asttree.IsNameTest(), System.Xml.Schema.Asttree.IsSelf(), MS.Internal.Xml.XPath.XPathParser.ParseXPathExpression(), System.SR.Sch_EmptyXPath, System.SR.Sch_ICXpathError, System.SR.Sch_SelectorAttr, System.Xml.Schema.Asttree.SetURN(), and System.value.

Referenced by System.Xml.Schema.Asttree.Asttree().