Skip to content

How do you ask for multiple specific elements in xpath? #27

@bitparity

Description

@bitparity

I'm going back over some of the xpath exercises from the last one, and I wanted to write an xpath for question 2.1, "Write an axis expression that finds all sibling elements of second-level divs," but that would exclude other divs.

I know //div/div/preceding-sibling::*[name(.) != "div"] works, but to make it proper, i need a following-sibling version. How do I ask for preceding-sibling::* AND following-sibling::* with my given predicate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions