Skip to Main Content

Integration

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!

OSB : Replace action inside a for loop

Ramesh M SDec 9 2010 — edited Feb 28 2013
Hi All,

It’s seems to be a simple issue but I’m breaking my head for quite sometime now.

I have a repeating element in my schema. I need to get the value of this repeating element and convert it into Upper case.

Eg:
My XML
<Telephone>
<Telephone Number>
<phoneUsage>Contact</phoneUsage>
<phoneNo>767676</phoneNo>
</Telephone Number>
 
<Telephone Number>
<phoneUsage>Callback</phoneUsage>
<phoneNo>767676</phoneNo>
</Telephone Number>
</Telephone>
I need to change the phone Usage value (Callback and Contact) to upper case

For this I am using a For loop:
For variable TelephoneNumber in ./Telephone/TelephoneNumber of variable body
Indexed by variable TelephoneNumberIndex with total count in variable TelephoneNumberCount
 
Do
(
Replace $body/Telephone/TelephoneNumber/phoneUsage in variable body with 
fn:upper-case($body/Telephone/TelephoneNumber[xs:int(i)]/tro:phoneUsage)
)
I am not sure how to pass the index value in the Replace Xpath expression $body/Telephone/TelephoneNumber/phoneUsage.
Can you please help me on this? I tried $body/Telephone/TelephoneNumber[xs:int(i)]//phoneUsage but this throws an error.

Thanks in advance for your time and support.
This post has been answered by Anuj Dwivedi-Oracle on Dec 9 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2013
Added on Dec 9 2010
11 comments
2,622 views