HTML tags in XML

Devin Asay devin_asay at byu.edu
Tue Mar 21 11:56:40 EST 2006


On Mar 21, 2006, at 9:12 AM, Trevor DeVore wrote:

> On Mar 21, 2006, at 7:43 AM, Devin Asay wrote:
>
>> Hi Folks,
>>
>> Is it possible to store html styled text in an xml document and  
>> then successfully retrieve the text with html markup intact?

<snip>  ;-)

>> Is there a way to do this? Will I have to resort to saving the  
>> RTFtext in the xml node or something like that?
>
> Hi Devin,
>
> You need to escape ", ', <, and < when entering data into an XML  
> node.  I can't remember if RevXML has any handlers for this or if  
> you just have to do it by hand.  For an example of the escape  
> characters just do a Google search for "xml escape characters".
>
> You may want to check out Ken Ray's XML library.  I haven't used it  
> but browsing through the API, there is a stsXML_replaceEntities  
> that looks like it would do what you want.

Thanks Trevor. I already knew that I had to escape those characters,  
plus '&' when writing xml. You triggered a "Duh!" moment in my brain,  
as it dawned on me that I'd also have to escape those other  
characters in my html markup.

It's working now.

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the Use-livecode mailing list