I have a problem with the XPath function. I have to pull out only the entries in the XML file that their name ends with the letter "z" and I cannot get it to work. I am xmllint to manipulate the file with the cat command.
ends-with() only works on XPath 2.0, and I'm sure the server has only XPath 1.0, so I tried to enter this command:
cat //country/city[substring(@name, string-length(@name) - string-length('z') +1)]/name
but I get an error all the time, and I'm not sure if I am writing it incorrectly or if this is not the right way to do this.
source
share