Open fersman opened 8 years ago
I have the same issue almost 3 years later. I was trying to parse a file with @id, @value, @key. So I guess I'll fall back on sax.js.
Just for checking, I patched line 1272 in my \node_modules\oboe\dist\oboe-node.js which is in the source here: oboe.js/src/jsonPathSyntax.js to add '@' in this line:
namedNode = /([@\w-_]+|*)/
and it seems to handle now some of my cases. For a real fix, it would probably a real fix with @ optional in the regex and same fix for "fieldList" and "optionalFieldList".
I have not found a way to add listener for node name with '@'. I tried: @node \@node ['@node'] ['\@node']
Is there a way?
Example code:
let s = new Readable(); s.push('{"@hello": "world"}'); // the string you want s.push(null); // indicates end-of-file basically - the end of the stream
oboe(s) .on('node', { "['@hello']": function (row) { console.log(row); } }) .on('done', function() {});