Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

translate() function in an xpath predicate

398079Jul 1 2003 — edited Jul 2 2003
I'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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2003
Added on Jul 1 2003
1 comment
264 views