Closed brolinuk closed 6 years ago
Maybe $.tree.taxonomy.['100177']
nope, this doesn't work
objc[48631]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. Exception in thread "main" org.antlr.v4.runtime.misc.ParseCancellationException at org.antlr.v4.runtime.BailErrorStrategy.recoverInline(BailErrorStrategy.java:66) at org.antlr.v4.runtime.Parser.match(Parser.java:206) at org.jsfr.json.compiler.JsonPathParser.childNode(JsonPathParser.java:647) at org.jsfr.json.compiler.JsonPathParser.relativePath(JsonPathParser.java:254) at org.jsfr.json.compiler.JsonPathParser.path(JsonPathParser.java:134) at org.jsfr.json.compiler.JsonPathCompiler.compile(JsonPathCompiler.java:233) at org.jsfr.json.SurfingConfiguration$Builder.bind(SurfingConfiguration.java:131) at com.waitrose.spike.json.JsonSurfDemo.surfParse(JsonSurfDemo.java:75) at com.waitrose.spike.json.JsonSurfDemo.main(JsonSurfDemo.java:120) Caused by: org.antlr.v4.runtime.InputMismatchException at org.antlr.v4.runtime.BailErrorStrategy.recoverInline(BailErrorStrategy.java:61) ... 8 more
@brolinuk Can you provide a sample json?
$.tree.taxonomy['100177'] This one should work.
This seems working. Thanks.
Does it mean it has to use bracket–notation when the key is a number? I wasn't aware that the combination of bracket-notation and dot-notation can be used.
Yes. bracket-notation has to be used to prevent the ambiguous of numeric key.
It looks like the path could not be parsed if the node key is a number, such as "$.tree.taxonomy.100177". Is there a dedicated expression that used for this case to work?