opened
yang-catalog
username_0
Improve YANG parsing for xPaths (when, must) substatements
issue
created
mbj4668
username_1
This looks very useful.  Could you also add test cases that demonstrate / test  these new capabilities?
comment
created
yang-catalog
username_0
hi, @username_1  could you please let me know what kind of error is that in the travis? I have no idea how to fix that. thank you in advance.

Miroslav K.
comment
created
mbj4668
username_1
It checks that the test doesn't leave any temporary files behind, I think.

$ git ls-files . --exclude-standard --others | tee "$TMP"
test/test_xpath/temp.txt

BTW. in all error strings etc, "xpath" should be spelled "XPath".  That's
the official name.  No "Xpath", "XPATH" or "xPath".
comment
created
yang-catalog
username_0
Ok got it thx
comment
created
mbj4668
username_1
I just realized that you treat a missing node as a XPATH_SYNTAX_ERROR.  This is unfortunate, and not really correct.  It is strictly speaking not an error to refer to a non-existing node.  It would be best to define a new error, perhaps XPATH_MISSING_NODE for these.  By default, XPATH_MISSING_NODE should be a warning, not an error.  By separating these thing in our code, we give the user more flexibility.
comment
created
yang-catalog
username_0
Done
comment
created
mbj4668
username_1
After merging, I fixed the code to align with the 80 characters line length convention, and cleaned the test case a bit.

But I'm not happy about the XPATH_MISSING_NODE text; it used to say:
ietf-netconf-notifications@2012-02-06.yang:286: warning: XPath node ../confirm-event != 'timeout' is missing

it now says:

ietf-netconf-notifications@2012-02-06.yang:286: warning: XPath for "../confirm-event != 'timeout'" does not exist

which is also not good.  it should say:
The node ../confirm-event is nout found

or soemthinh similar.  Is this something you can look at?
comment