there are two issues:
1) the prefix "ex" needs to be declared in the XML for it to be well-formed, such as with a xmlns:ex:"..." statement.
2) the xpath prefix needs to be used in all symbols in the xpath, not just the uppermost, eg it should be /ex:c/ex:a1
Therefore, without looking at how to fix it, the message should be something like:
I think problem nr 2 can be fixed by
1) (best) finding the namespace (not prefix) and checking if that is declared in the xml node at hand using xml2prefix(), if yes then use the retirned prefix, else create new.
2) if you want to stick with the prefix, then check with xml2ns() if it exists and bound to the right namespace, and create it if it is not present.
While I agree on the error statement, the patch in
xml2xpath1()
only solves it partly. For example, in the return in text_minmax.sh:there are two issues: 1) the prefix "ex" needs to be declared in the XML for it to be well-formed, such as with a
xmlns:ex:"..."
statement. 2) the xpath prefix needs to be used in all symbols in the xpath, not just the uppermost, eg it should be/ex:c/ex:a1
Therefore, without looking at how to fix it, the message should be something like:Likewise in test_yang_deviation.sh
I think problem nr 2 can be fixed by 1) (best) finding the namespace (not prefix) and checking if that is declared in the xml node at hand using
xml2prefix()
, if yes then use the retirned prefix, else create new. 2) if you want to stick with the prefix, then check withxml2ns()
if it exists and bound to the right namespace, and create it if it is not present.