question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XPath expressions validity

See original GitHub issue

XPath expressions are considered with logical OR. However it would be nicer to change that to AND too. Best it would be to select between OR and AND

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
milkotodorovcommented, Sep 18, 2018

I think we need just one radio button saying how to combine all the expressions - OR or AND. Why need to be more complex? Currently actually it is not really clear at first look how they are combined…

1reaction
mhewedycommented, Sep 17, 2018

Why not use XPath expressions to accomplish such cases? (I am not sure about your use case)

For example this input xml:

<?xml version="1.0" encoding="UTF-8"?>
<root> 
  <user> 
    <login>user1</login>  
    <name>User 1</name>  
    <profile> 
      <id>2</id>  
    </profile>  
    <profile> 
      <id>1</id>  
    </profile> 
  </user>  
  <user> 
    <login>user2</login>  
    <name>User 2</name>  
    <profile> 
      <id>4</id>  
    </profile>  
    <profile> 
      <id>5</id>  
    </profile> 
  </user> 
</root>

This xpath would succeed: .//user[login='user1' and name='User 1' and profile/id[text()='1'] ]

This whould fail: .//user[login='user1' and name='User 1' and profile/id[text()='5'] ]

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve the error "Not a valid XPath expression"
1 Answer 1 · As you are passing the xpath within single quotes i.e. '' you can't use the same for the attribute...
Read more >
Xpath | Citrus Reference Guide
This is how you can add very powerful message element validation in XML using XPath expressions. Extract variables with XPath. Imagine you receive...
Read more >
XPath expression evaluation - IntelliJ IDEA - JetBrains
IntelliJ IDEA lets you evaluate XPath expressions in two modes: ... Semantic checks include validation of used namespace prefixes, useless XPath expressions ...
Read more >
XPath Quick Reference (XQuery and XSLT Reference Guide)
To test an XPath expression for validity as an extract-path value, use the XQuery function cts:valid-extract-path or the Server-Side JavaScript function cts.
Read more >
Using Expressions and Conditions - Oracle Help Center
Creating XPath Expressions and Functions Using the XPath Wizard ... Note that validation does not check the validity of workflow variable referenced by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found