Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Regarding tags

From: greggirwin:mindspring at: 2-Aug-2002 9:54

Hi Charles, << The emphasis here is the ability to get the image's path so I can append it to a URL, and when I'm done, alter the image's path and save the new <IMG SRC= tag back into the source. >> I haven't done much with tags myself, but there are often times where it just isn't as easy as you think it should be to modify data while preserving original formatting. Here I use the /ALL refinement on parse and MOLD to try and simplify things.
>> imgtag: <IMG SRC="../somedir/someimage.jpg">
== <IMG SRC="../somedir/someimage.jpg">
>> parse/all imgtag {"}
== ["IMG SRC=" "../somedir/someimage.jpg"]
>> b/2: "../somedir/newimg.jpg"
== ["IMG SRC=" "../somedir/newimg.jpg"]
>> to tag! join b/1 mold b/2
== <IMG SRC="../somedir/newimg.jpg"> --Gregg