Comments (1)
Hi @Scnck,
There are at least two ways to do this (that I know of). The examples below uses the XPath Evaluator at https://www.defiantjs.com/ The first one is this - enter the following XPath in the input field:
//store[.//isbn]/bicycle
...this "tells" that we are looking for the store node and make a sub-query with "[...]". In this case I added that I want to make further search with store as "base".
The second one is this:
//@price[ancestor::book//category = "fiction"]
...this "tells" that we want @price but only if it's ancestor is "book" and @price are among the one with category of "fiction". With "//", the query is looking for matches that is regardless of "depth" - meaning "category" and "@price" does not need to be on the same level in depth if the data structure.
I hope this helps. I would like to suggest that you cut and paste part of your JSON data in to the Evaluator by clicking the "pen". This way you can experiment your way to the right query you are looking for. I am closing this issue - re-open it, if you need further assistance.
from defiant.js.
Related Issues (20)
- Cannot install via Yarn HOT 8
- Support all UTF8 character set ! HOT 2
- NodeJS API documentation? HOT 10
- does not work in IE11 HOT 9
- NodeJS: registering multiple templates is not possible HOT 1
- Question: XSLT, XPath versions HOT 1
- NodeJS XML <-> JSON HOT 3
- Not able to find values with & HOT 2
- Chrome 70 breaks JSON.search HOT 2
- Multiple callback calls on async getSnapshot HOT 4
- Does not pass "use strict" HOT 1
- Split packet so npm users don't need to install pupeteer on pure browser installation HOT 8
- Defiantjs.com Certificate HOT 1
- TypeError: Cannot read property 'search' of undefined HOT 1
- TypeError: null is not an object (evaluating 'constr.toString().match(self.rx_function)') HOT 2
- Handle keys with numbers HOT 1
- Nodejs: Session closed when running defiant.search a second time HOT 1
- Currently unable to pass args to puppeteer launch method. HOT 1
- no search result, if first letter capital Ä (umlaut) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from defiant.js.