777
Views
8
Comments
How to introduce double quotes ("") in "Replace" function
Question
Hello people,

I have generated some text and I want to replace some text along with double quotes.
Generated text  : <group>

I want to replace it as <group id="C101">.

I tried like this Replace(Temp,"<group>","<group id=""C101"">") but it's not working.

Please advice.

Thanks and Regards,
Suraj Borade

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Hi Suraj,

It does work, it's just that the debugger also shows the double double quotes. I've just made a test, and if I display the string on screen it works fine (as was to be expected).
2016-04-21 20-09-55
J.
 
MVP
what is not working?
what is the result?

it's working fine here.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
That's what I said J :).
2018-11-06 14-26-44
Suraj Borade
Hello,

Thanks a lot for the reply.

In the morning, I generated one XML and assigned XML result to Local variable. Inside local variable, I replaced one "<group>" tag as explained but it gave me result like this <group id=C101>

I will try one more time.
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Hi Suraj,

What tool did you use to generate the XML? May the tool itself be at fault?
2018-11-06 14-26-44
Suraj Borade
Kilian sir,

I used RecordListToXML control from XML extension.

Actually, I want to generate XML like this

<group id="CH101">
   <trans-unit id="CD101" resname="Ext Product>
      <source>External products for sale team</source>
     <target>External products for sale team</target>
  </trans-unit>
</group>

Here, I am not getting how to generate attribute for first "group" node, so I thought to manually replace it.

I know we will have to configure attributes for this but I am not getting how to set those attributes. 

If you can tell how to set up attributes for external tags like "group", it would be helpful.

Thanks a lot.
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Unfortunately, I have little experience with RecordListToXML. You may try to ask at the component's forum.
2018-11-06 14-26-44
Suraj Borade
Thanks a lot sir.

For now I am able to generate an XML. But I had to do some manual changes with Replace function which we should avoid if we are using this control. 

We have escalated this issue to Outsystems for demo of XML generation.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.