Skip to content

passsing variable to conditional xpath expression returns null whereas passing value gives result #372

@iamihgam

Description

@iamihgam

I have a variable say x which can take any integer value.

When I try to pass the value directly (say, x=0) instead of variable as below, I get respective nodes

root_unitgroup %>% xml_find_all("//*[@dataSetInternalID = '0']")

however, if I pass variable as below , I get empty node, or null value if I use xml_find_first instead .

root_unitgroup %>%  xml_find_all("//*[@dataSetInternalID = '$x']")

Metadata

Metadata

Assignees

No one assigned

    Labels

    reprexneeds a minimal reproducible example

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions