Correct escaping of list keys with single quotes

YANG 1.1 still uses XPath 1.0 which defines [1] strings in such a manner
that it is impossible to represent both single and double quotes in the
same string. That's why sysrepo chokes on such XPaths, for example.

Let's just ensure that anything which already contains an apostrophe (a
single quote) will be double-quoted instead of the default single-quoted
thingy.

Note that the parser itself treats all list keys as strings internally;
there's no validation, and the information about the underlying data
type is not preserved. That's why a numeric list key would be still
single-quoted in the current code.

[1] https://www.w3.org/TR/1999/REC-xpath-19991116/#exprlex

Change-Id: I87a2b88bb4f5d8f3383c1637088980c5a670aee3
2 files changed
tree: fcb2b217c09f2603361cb4c306d5a8293369d92d
  1. .clang-format
  2. .gitmodules
  3. CMakeLists.txt
  4. Doxyfile.in
  5. LICENSE
  6. README.md
  7. ci/
  8. cmake/
  9. docs/
  10. src/
  11. submodules/
  12. tests/
README.md

Console interface to NETCONF servers

Credits

Copyright © Faculty of Information Technology, Czech Technical University in Prague, https://fit.cvut.cz/ . Copyright © CESNET, https://www.cesnet.cz/ . Most of the code was written by Václav Kubernát (FIT ČVUT) and Jan Kundrát (CESNET). The project is distributed under the terms of the Apache 2.0 license.