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.

escape characters in xpath

421886Feb 26 2007 — edited Feb 26 2007
Hello,

I use the folowing statement to retrieve xml data:
select p.pack_content from packages p
where existsNode(p.pack_content,'/WEZEL/KONTRAHENCI/KONTRAHENT[AKRONIM="acronim_value"]')=1

The statement is generated in Java and the value of XPath condition changes depending on the acronim_value:

For acronim_value=BC

the statement looks like:
select p.pack_content from packages p
where existsNode(p.pack_content,'/WEZEL/KONTRAHENCI/KONTRAHENT[AKRONIM="BC"]')=1

The problem is that acronim_value maybe "BC
so the statement is the following:

select p.pack_content from packages p
where existsNode(p.pack_content,'/WEZEL/KONTRAHENCI/KONTRAHENT[AKRONIM=""BC"]')=1

I get ora-31013 error as the xpath is invalid. How should I write the statement to escape " double qoutation character to create valid xpath.

Grzegorz.

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 26 2007
Added on Feb 26 2007
2 comments
1,989 views