137
Views
5
Comments
Solved
[XML Records] XML RECORDS
Question
xml-records
Service icon
Forge asset by Afonso Carvalho

It´s possible use the markups <![CDATA[]]> when convert an record to xml?


Example: <Quantity><![CDATA[3]]></Quantity>

Thanks.

2020-01-29 14-47-45
Filipe da Silva
Solution

If your record has a Text field named Quantity 

and you assign this on it: 

"<![CDATA[]]>" 

or this: 

"<![CDATA[" + _____ + "]]>"          - where the line is anything you can concat to a string


This should work 

2019-06-15 21-39-22
Afonso Carvalho
 
MVP

Hi João,

If you want to identify data as character data (CDATA), I believe you have to append it to your values like Filipe mentions.

I had to create some logic to process XML with CDATA tags and what was happening was that the conversion process would automatically delete those tags from the processed content when you tried to process this data back into a record, so make sure this also fits in your use case if you need to process the data back into OutSystems.

UserImage.jpg
João Pinheiro

João Pinheiro wrote:

It´s possible use the markups <![CDATA[]]> when convert an record to xml?


Example: <Quantity><![CDATA[3]]></Quantity>

Thanks.

Right, but when I execute the  recordtoxml, it replace the "<" for "& lt;" and the  ">" for "& gt;"


2020-01-29 14-47-45
Filipe da Silva

João Pinheiro wrote:

João Pinheiro wrote:

It´s possible use the markups <![CDATA[]]> when convert an record to xml?


Example: <Quantity><![CDATA[3]]></Quantity>

Thanks.

Right, but when I execute the  recordtoxml, it replace the "<" for "<" and the  ">" for "& gt;"


I haven't done this in awhile but try this :

EncodeHtml("<![CDATA[]]>" ) 

UserImage.jpg
João Pinheiro

Filipe Silva wrote:

João Pinheiro wrote:

João Pinheiro wrote:

It´s possible use the markups <![CDATA[]]> when convert an record to xml?


Example: <Quantity><![CDATA[3]]></Quantity>

Thanks.

Right, but when I execute the  recordtoxml, it replace the "<" for "<" and the  ">" for "& gt;"


I haven't done this in awhile but try this :

EncodeHtml("<![CDATA[]]>" ) 

Hi, 

The & lt; and > is a good practice for xml files. So, i will leave as it is. Thanks for your support. 



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.