Hi Sanjeev,

It seems that output created in a ui:Function is always assumed to be HTML, and 
I can’t find a way to change that.

Fortunately, there is another way of using ui:Function that should work here. 
Instead of returning a result from the function by rendering it with 
<ui:parse>, use <ui:return> to directly specify it:

    <ui:return ui:result="{= ui:globalVarValue(&quot;subTags&quot;) }"/>

This avoids the conversion of the assembled string into XML done in ui:parse, 
and back from XML (or rather, HTML; hence our problem) to a string after the 
execution of the ui:Function.

(Side note: I’m a bit worried about the use of a global variable in a recursive 
function. From your output it looks like you have it working, but in the 
recursive function call, isn’t the string that is being assembled in the parent 
overwritten when the child executes?)

Richard


> On 13 Feb 2019, at 12:11, Sanjeev Devireddy <[email protected]> 
> wrote:
> 
> Hi Richard,
>    For sub-tags, I removed the ui:stringify. But, there is a recursive 
> function (which is subclass of ui:Functions) to recursively traverse though 
> all nodes in a Taxonomy hierarchy. This recursive function (named 
> geographyOutput:getChildren) returns a tag (including child/sub tags) for a 
> given node. It seems, by default the return type of the function (which is 
> subclass of ui:Functions) is string and there is no type like xml or 
> xml-string to select as return type. So, if there are any special characters 
> in the tag(s) returned by that functions then those special characters are 
> not rendered properly. Could you please suggest a solution for this? Please 
> find the attachments fro the for the source code(geographyOutput.ui.ttlx) and 
> the output(geography_output.xml). This example refers to the Geography 
> Taxonomy that comes by default with the EDG application.
> Call with http://localhost:8083/tbl/swp?_viewClass=geographyOutput:getOutput.
> 
> <Auto Generated Inline Image 1.png>
> 
> Current Output snapshot
> <Auto Generated Inline Image 2.png>
> 
> 
> 
> Thanks,
> Sanjeev
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> <geographyOutput.ui.ttlx><geography_output.xml><Auto Generated Inline Image 
> 1.png><Auto Generated Inline Image 2.png>

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to