Hi,
I have a use case where I need to validate if a list has one particular entry. I do not have complete information about the key. I have only partial string. So I need to use re-match for my validation.
Here is the must rule that I used:
tailf:annotate "/secu:security/dataenc:data-encryption/dataenc:interface/dataenc:ifName" {
must "re-match(/if:interfaces/if:interface/if:name, 'ip-1/1/0/E1.1:0')" {
error-message "IP interface is must to enable data encryption";
}
}
interface is the list here.
For simplicity sake, I have hardcoded the pattern here. But in my actual use case, I need to derive the pattern from the current() value.
From xpathTracing logs, I observe that it is not traversing through the list to check all the entries. It fails to match the very first entry in the last and then returns with failure.
My expectation is that it has to iterate through the list and return failure only when it is unable to match at least one entry.
Could someone let me know if this is possible to let re-match iterate through the list?
Regards,
Vaishnavi CU