commit | 2a8f43369a43d5074689bf54e65af36e95f0ebf3 | [log] [tgz] |
---|---|---|
author | Jan Kundrát <jan.kundrat@cesnet.cz> | Fri Sep 14 17:05:31 2018 +0200 |
committer | Jan Kundrát <kundrat@cesnet.cz> | Fri Sep 14 17:19:41 2018 +0200 |
tree | fcb2b217c09f2603361cb4c306d5a8293369d92d | |
parent | 3081afad32f08e1384e36171f428a37c5dc957d2 [diff] |
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
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.