You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the xpath method only returns node lists. So for example, functions like count(), boolean(), string(), ... don't work.
Very simple (and silly) example:
I expect the output to be twice int(2), instead the output from xpath is an empty array.
Either we should have an additional method for arbitrary xpath evaluations (like in the case of DOM), or the xpath method should be changed to auto-detect the return type of the query. Both are feasibly, but the last one could be a BC break because of the return type change.
The text was updated successfully, but these errors were encountered:
nielsdos
changed the title
SimpleXML xpath allow other types of return than node lists
SimpleXML xpath should allow other return types than node lists
Sep 17, 2023
nielsdos
changed the title
SimpleXML xpath should allow other return types than node lists
SimpleXML xpath should warn when returning other return types than node lists
Mar 15, 2025
Description
Currently, the xpath method only returns node lists. So for example, functions like count(), boolean(), string(), ... don't work.
Very simple (and silly) example:
3v4l: https://3v4l.org/nmD4k
I expect the output to be twice
int(2)
, instead the output from xpath is an empty array.Either we should have an additional method for arbitrary xpath evaluations (like in the case of DOM), or the xpath method should be changed to auto-detect the return type of the query. Both are feasibly, but the last one could be a BC break because of the return type change.
The text was updated successfully, but these errors were encountered: