jquery - Using Xpath selectors to extract / combine data from Javascript Objects? -


i'm quite fond of cakephp set class, comes few awesome tools love. use extract or combine arrays.

i wondering if there way javascripts objects/arrays of data.

// desired usage: var users = {user: {0:{id:1,name:'a'},1:{id:2,name:'b'}}} var results = $.extract('/user/id', users); // results returns: // {0:1,1:2};  // /user[id>2][<5]  selects users id > 2 < 5 

it support on jquery or maybe sizzle.

do have develop thoses functions 0 or there native/plugin xpath selector/extractor support out there ? can sizzle ?

thanks lot!

look library http://code.google.com/p/jsonpath/
not sure, whether process request in syntax: user[id>2][<5],
it's rather powerful library , should have similar feature.

even if there's no function request parts "[<5]", may call

.slice(0, 5); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -