On 09/02/2012 20:24, Klaus on-rev wrote:
in my current project I need to deal with VERY small XML files
with maybe up to 20 entries.

Wait, didn't we just hear that you can't parse html (or XML) with regexps? *grin*

function mk_getXMLdata tText, tTag
    get matchText(tText,"(?s)<"&  tTag&  ">(.*?)</"&  tTag&  ">",tValue)
    return tValue
end mk_getXMLdata

Throwing caution to the winds, this probably does something similar to what you want without further regexp voodoo:

function mk_replaceXMLdata tText, tTag, tNewText
   put tText into tValue
   if matchText(tText,"(?s)<"&  tTag&  ">(.*?)</"&  tTag&  ">",tValue) then
      put replaceText(tText, \
      "<"&tTag&">"&tNewText&"</"&tTag&">") into tValue
   end if
   return tValue
end mk_replaceXMLdata

And remember: zalgo is tony the pony! He's a comin!


use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your subscription 

Reply via email to