Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
iamihgam opened this issue Aug 13, 2022 · 2 comments
Labels
reprex needs a minimal reproducible example

Comments

@iamihgam
Copy link

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']")
@hadley
Copy link
Member

hadley commented Oct 30, 2023

Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you! If you've never heard of a reprex before, start by reading about the reprex package, including the advice further down the page. Please make sure your reprex is created with the reprex package as it gives nicely formatted output and avoids a number of common pitfalls.

@hadley hadley added the reprex needs a minimal reproducible example label Oct 30, 2023
@hadley
Copy link
Member

hadley commented Oct 21, 2024

I've closed this issue due to lack of requested reprex. If you still care about this bug, please open a new issue with a reprex.

@hadley hadley closed this as completed Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants