Skip to Content
avatar image
Former Member

Return As XML in a UDF

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • 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.

    Add comment
    10|10000 characters needed characters exceeded

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

    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.

    Add comment
    10|10000 characters needed characters exceeded