nodules / xamel

Fast and cozy way to extract data from XML
MIT License
30 stars 5 forks source link

buildPath doesn't work as expected #9

Closed Flackus closed 11 years ago

Flackus commented 11 years ago

XML is http://phd.yandex.net/detect?user-agent=Mozilla%2F5.0%20%28iPhone%3B%20U%3B%20CPU%20iPhone%20OS%204_0%20like%20Mac%20OS%20X%3B%20en-us%29%20AppleWebKit%2F532.9%20%28KHTML%2C%20like%20Gecko%29%20Version%2F4.0.5%20Mobile%2F8A293%20Safari%2F6531.22.7

buildPath : 'yandex-mobile-info/name'
...
console.log(JSON.stringify(xml));

Result would be:

[{"name":"name","text":"iPhone"}]

And then:

buildPath : 'yandex-mobile-info/name/text()'

Result would be:

[]

Is it possible to make syntax consistent as in NodeSet methods?

kaero commented 11 years ago

Ok, the inPath function needs some refactoring…