Skip to content

Can't distinguish single nodes from lists with one item #2

@IMSoP

Description

@IMSoP

There is currently no way of distinguishing between a single element (e.g. $sxml->Result[0]) and a list of elements (e.g. $sxml->Result or $sxml->children()) which happens to include only one item. They can however behave differently - foreach ( $sxml->Result[0] as $result ) is equivalent to foreach ( $sxml->Result[0]->children() as $result ).

As far as I can see, there is no way of determining this with the current API. However, since the behaviour is different, the extension itself clearly tracks this distinction. It should probably be raised with the maintainers to add PHP access to this property for a future release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions