Hi Sanjeev,

As I said earlier: For ui:parse to work, its ui:str attribute must be a 
complete XML element, with opening tag, any child content, and closing tag. If 
ui:str is not a complete element (e.g., if it is only an opening tag or only a 
closing tag, as in getContinents.swp), then ui:parse will simply output the 
value of ui:str, without turning it into proper XML.

So, this will work because it’s a complete element with child content:

    <ui:parse ui:xml="true" ui:str="&lt;element&gt;content&lt;/element&gt;"/>

It will output: <element>content</element>

This won’t work, because it’s not a complete XML element (only an opening tag):

    <ui:parse ui:xml="true" ui:str="&lt;element&gt;"/>

It will output: &lt;element&gt;

So you need to assemble the entire XML element, including child content, as a 
single string variable, and then pass that as ui:str.

To generate the child content as a string variable, ui:bind/ui:stringify might 
be useful:
http://uispin.org/ui.html#bind

Here is an example:

    <ui:bind let:tagName="ParentElement">
        <ui:stringify ui:varName="content">
            <ChildElement value="xyz"/>
        </ui:stringify>
        <ui:parse ui:xml="true" ui:str="&lt;{= ?tagName }&gt;{= ?content 
}&lt;/{= ?tagName }&gt;"/>
    </ui:bind>

It will output:

    <ParentElement>
        <ChildElement value="xyz”/>
    </ParentElement>

Richard



> On 24 Aug 2018, at 06:53, Sanjeev Devireddy <devireddy.sanj...@gmail.com> 
> wrote:
> 
> Hi Richard,
>    Is there a way to replace &lt; and &gt; with < and > in the final xml 
> output, by using spin functions or by integrating SWP with SPARQL Motion 
> script?
> 
>     Why am I asking this is, our current legacy system generates many xml 
> outputs. These xml outputs are consumed by downstream applications using 
> XPATH. So it would be good if exactly similar outputs are generated from the 
> TopBraid so that the our downstream applications don't need to make any code 
> changes in their applications.
> 
> 
> 
> 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 topbraid-users+unsubscr...@googlegroups.com 
> <mailto:topbraid-users+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to