Skip to Main Content

DevOps, CI/CD and Automation

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!

Can a Xquery return a concatenated string and an XML element

KalpanaJglMar 18 2013 — edited Mar 18 2013
Hi,

My Xquery fucntion is shown below:

It accepts 4 string parameters and an XML element i.e., $Message which is an XML element(request coming to the service) and i need to log all this information to a log file.

I am using the below concat fucntion to get a concatenated string of all the parameters but, for $Message i m not able to get the XML payload. How to achieve the same in the Xquery?

*$Message is the below XML file:*

<payload>
<aa>one</aa>
<bb>two</bb>
<cc>three</cc>
</payload>

My Xquery function is:

declare function xf:XformLog($Name as xs:string,
$id as xs:string,
$Context as xs:string,
$Annotation as xs:string,
$Message as element(*))
as xs:string {
concat("Name = ",$Name," , ","Id = ",$id," , ","Message Context = ",$Context," , ","Annotation = ",$Annotation," , ","Event Message = ", data($Message/@* , $Message/node()))
};


I am trying to achieve the following log:

Name = xyz, Id = 111, Message Contact = abc, Annotation = ggg, Event Message = <payload>
<aa>one</aa>
<bb>two</bb>
<cc>three</cc>
</payload>


How can i achieve the same. Please suggest.

Thanks in advance.

Edited by: user9223904 on Mar 18, 2013 3:16 AM
This post has been answered by odie_63 on Mar 18 2013
Jump to Answer

Comments

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

Post Details

Locked on Apr 15 2013
Added on Mar 18 2013
1 comment
1,609 views