Skip to Content
0

Return As XML in a UDF

Nov 28, 2016 at 03:36 AM

306

avatar image
Former Member

I have a requirement where I need to achieve the functionality of Return As XML for an output of UDF. UDF outputs XML in string format where I am mapping to a cloned node ( Duplicate Subtree). UDF XML Output automatically encapsulating in CDATA where I require to be return As XML. Is there anyway I can achieve this. Appreciate for your response for the same.

Thank you,

Rao

10 |10000 characters needed characters left characters exceeded

Hi Rao!

Wouldn't you please provide an example of your UDF output and your desired result structure?

Regards, Evgeniy.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Evgeniy Kolmakov Nov 28, 2016 at 04:20 AM
-2

Hi Rao!

You can try something like this:

UDF:

public String addSubTree(String inputTree, Container container) throws StreamTransformationException{

StructureNode node = (StructureNode)(container.getParameter("STRUCTURE_NODE"));
node.setPreValue(inputTree);

return "";

I've passed xml fragments as constants to simplify mapping. You should remove CDATA tag and xml header string from your source string and pass it as parameter to UDF.

Regards, Evgeniy.


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Also remove ObjectEvent tag as well.

Regards, Evgeniy.

0
avatar image
Former Member Nov 28, 2016 at 03:57 AM
0

Output of UDF GetQuery is xml in string format. When I am assigning it to ObjectEvent element its getting encapsulating in CDATA. Where I want return As XML functionality. Appreciate for your response.


capturemain.jpg (69.7 kB)
capturem2.jpg (59.3 kB)
capturem2.jpg (59.3 kB)
Share
10 |10000 characters needed characters left characters exceeded