translate() function in an xpath predicate
398079Jul 1 2003 — edited Jul 2 2003I'm trying to use the translate() function in an xpath predicate, and it appears to be having no effect. For instance, I have the following XML document (abbreviated for clarity):
<metadata>
<baseObject>
<PublicationTime>2003-06-30T21:45:56Z</PublicationTime>
</baseObject>
</metadata>
The following xpath expression returns no nodes:
metadata[translate(baseObject/PublicationTime, "-:TZ", "") = "20030630214556"]
But this next expression does return a node:
metadata[translate(baseObject/PublicationTime, "-:TZ", "") = "2003-06-30T21:45:56Z"]
It appears to me that the translate function is not removing the -, :, T, and Z characters as would be expected. Am I misunderstanding the usage of the translate function, making an error in my xpath expression, or is there some other explanation?
Thanks.
Brian