replace text in XML Node

Sarah Reichelt sarahr at genesearch.com.au
Sun May 8 19:58:44 EDT 2005


> I want to get the text inside an xml node and then do stuff (in this  
> case add <br /> html line breaks) and then reinsert that back into the  
> node.
>
> this gets me almost there;
>
> put revXMLNodeContents(gCurrTree,"/audio_transcript/transcript_text")  
> into tTrans
>   replace (cr & cr) with ("<br />"&cr & "<br />" & cr) in tTrans
>
> ## now how do I reinsert that back into the node:  
> "/audio_transcript/transcript_text"
> replacing the previous content?
>
> I don't see an XML command in the Rev library that actually does  
> that... or I missed it... I read through all the XML commands (not  
> RPC... whatever that is....)
>
>  put tTrans into  
> revXMLNodeContents(gCurrTree,"/gurudeva_audio_transcript/ 
> transcript_text")
>
> returns an error...
>

Try the revPutIntoXMLNode command.
You might like to have a look at my XML demo stack which shows how to  
do all the basics:
<http://www.troz.net/Rev/RevProjects/XMLdemo1.rev.gz>

Cheers,
Sarah



More information about the use-livecode mailing list