tail-f-systems / JNC

JNC (Java NETCONF Client) is the name of a Java library for communicating with NETCONF agents, and a plugin for pyang (http://code.google.com/p/pyang/) to generate Java classes from YANG models, to be used by the JNC library.
Other
77 stars 87 forks source link

Does method "Element create(String namespace, String pathStr)" support xpath which has multiple conditions ? #88

Closed buddha1987 closed 1 year ago

buddha1987 commented 5 years ago

I try to use Element.create() to create an element from a Xpath which has multiple conditions, e.g.: xPath = "/a/b/c/[d=1 and e=2]". In this case, I got error : "Error in path: parse error: Error in path: parse error: at com.tailf.jnc.Path.parse(Unknown Source) at com.tailf.jnc.PathCreate.(Unknown Source) at com.tailf.jnc.Element.create(Unknown Source) at com.tailf.jnc.Element.create(Unknown Source)"

It looks like can't parse the Xpath with multiple conditions. Is there any way that Element.create can support that ?

Thanks.

kaposnick commented 5 years ago

Try something like this:

xPath = "/a/b/c[d=1][e=2].

This is supported.

martin-volf commented 1 year ago

Closing. The workaround described by @kaposnick should be enough.