HTML tags in XML

Ken Ray kray at
Tue Mar 21 13:30:31 EST 2006

On 3/21/06 11:51 AM, "Trevor DeVore" <lists at> wrote:

> On Mar 21, 2006, at 9:41 AM, Ken Ray wrote:
>>  My XML Library handles getting and setting CDATA information for a
>> node quite
>> easily
> Ken,
> This is good to know.  The RevXML external doesn't handle CDATA, does
> it?  I seem to recall that when I tested using CDATA with RevXML it
> didn't work which is kind of a bummer.

Actually, you can *retrieve* CDATA with revXMLNodeContents, but you can't
*set* it. That's part of the reason I'm still updating my XML Library. ;-)

Here's an example:

Contents of Field 1:
<?xml version="1.0"?>
      <![CDATA[<b>This is a test</b>]]>

put fld 1 into tXML
put revCreateXMLTree(tXML,true,true) into tID
put revXMLNodeContents(tID,"/root/test")

   <b>This is a test</b>

put revXMLText(tID)

  <?xml version="1.0"?>
  <root><test><![CDATA[<b>This is a test</b>]]></test></root>

Now, we try to set the data:

revPutIntoXMLNode tID,"/root/test","<b>This is another test</b>"
put revXMLText(tID)

  <?xml version="1.0"?>
  <root><test><b>This is another test</b></test></root>

Trying it with CDATA tags already around it:

revPutIntoXMLNode tID,"/root/test","<![CDATA[<b>This is another test</b>]]>"
put revXMLText(tID)

  <?xml version="1.0"?>
  <root><test><![CDATA[<b>This is another


Ken Ray
Sons of Thunder Software
Web site:
Email: kray at

More information about the Use-livecode mailing list