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.