Commit f408550
committed
fix ../ xpath queries
This commit implements robust support for the .. (parent) XPath selector.
Tree Structure Changes: It adds a _parent attribute to the Element class.
The init method and all list-modification methods are updated to automatically maintain this parent pointer when children are modified.
Path Resolution: It updates ElementPath.py to use these _parent pointers when resolving.
If a parent pointer is missing (e.g., for objects not attached to the current context), it falls back to building a temporary parent map by traversing from the root.1 parent 190cc4e commit f408550
3 files changed
+75
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 105 | | |
112 | | - | |
113 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
| |||
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
189 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
190 | 224 | | |
191 | 225 | | |
192 | 226 | | |
| |||
195 | 229 | | |
196 | 230 | | |
197 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
198 | 245 | | |
199 | 246 | | |
200 | 247 | | |
| |||
205 | 252 | | |
206 | 253 | | |
207 | 254 | | |
| 255 | + | |
| 256 | + | |
208 | 257 | | |
209 | 258 | | |
210 | 259 | | |
| |||
215 | 264 | | |
216 | 265 | | |
217 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
218 | 270 | | |
219 | 271 | | |
220 | 272 | | |
| |||
224 | 276 | | |
225 | 277 | | |
226 | 278 | | |
| 279 | + | |
| 280 | + | |
227 | 281 | | |
228 | 282 | | |
229 | 283 | | |
| |||
236 | 290 | | |
237 | 291 | | |
238 | 292 | | |
| 293 | + | |
| 294 | + | |
239 | 295 | | |
240 | 296 | | |
241 | 297 | | |
242 | 298 | | |
243 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
244 | 303 | | |
245 | 304 | | |
246 | 305 | | |
| |||
0 commit comments