[augeas-devel] Distinguishing empty string from no value in path expressions
Michael Chapman
mike at very.puzzling.org
Thu Oct 6 10:25:39 UTC 2011
On Wed, 5 Oct 2011, David Lutterkort wrote:
> 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
A null() function would be useful, however I'm not sure it should take a
nodeset as an argument. It doesn't make sense for it to be applied to more
than one node.
Perhaps it should be a no-argument predicate, "this node has no value".
Another question arises from all this: how would you match only non-null
nodes?
- Michael
More information about the augeas-devel
mailing list