[augeas-devel] Distinguishing empty string from no value in path expressions
David Lutterkort
lutter at redhat.com
Wed Oct 5 17:26:44 UTC 2011
Hi Michael,
On Wed, 2011-09-28 at 14:33 +1000, Michael Chapman wrote:
> With Augeas's path expressions, is it possible to distinguish a node whose
> value is an empty string from one that has no value? At the moment, nodes
> with no value appear to be treated the same as those with an empty string:
Currently, there is no way to do that. When path expressions are
evaluated, NULL's are automatically converted to the empty string to
avoid funky tri-state logic.
So far, nobody has needed that distinction, but it would be easy enough
to add a null function to the language so that you could pick out nodes
with null values, i.e. something like
match test/*[null(.)]
which, in your example, would match /test/b
Would that be good enough for your purposes ?
David
More information about the augeas-devel
mailing list