File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -222,13 +222,18 @@ export async function buildBackendIdMaps(
222
222
const tag = lc ( String ( child . nodeName ) ) ;
223
223
const key = `${ child . nodeType } :${ tag } ` ;
224
224
const idx = ( ctr [ key ] = ( ctr [ key ] ?? 0 ) + 1 ) ;
225
- segs . push (
226
- child . nodeType === 3
227
- ? `text()[${ idx } ]`
228
- : child . nodeType === 8
229
- ? `comment()[${ idx } ]`
225
+ if ( child . nodeType === 3 ) {
226
+ segs . push ( `text()[${ idx } ]` ) ;
227
+ } else if ( child . nodeType === 8 ) {
228
+ segs . push ( `comment()[${ idx } ]` ) ;
229
+ } else {
230
+ // Element node: if qualified (e.g. "as:ajaxinclude"), switch to name()='as:ajaxinclude'
231
+ segs . push (
232
+ tag . includes ( ":" )
233
+ ? `*[name()='${ tag } '][${ idx } ]`
230
234
: `${ tag } [${ idx } ]` ,
231
- ) ;
235
+ ) ;
236
+ }
232
237
}
233
238
// push R→L so traversal remains L→R
234
239
for ( let i = kids . length - 1 ; i >= 0 ; i -- ) {
You can’t perform that action at this time.
0 commit comments