I'm trying to run some XPath against an XML document and just select the element returned with a specific id. I am using the following:
id('some-value')
This works fine but I believe (correct me if I am wrong!) that the syntax of fn:id can be expanded so you can call
id('some-value', 'another-value')
which would return the elements that have the ids specified but I generate an error when calling the function like this. I am use the PHP DOM so it may be that the library doesn't accept this syntax.
Any ideas?
I think what you are looking for is id('some-value another-value')
.
I.e. a space separated list of id values as a single quoted argument.