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

[REBOL] Regarding tags

From: chalz:earthlink at: 1-Aug-2002 23:04

Hey! Yet another question from me :) How about this one. I have a tag, for instance:
>> imgtag: <IMG SRC="../somedir/someimage.jpg">
To break it into its constituent parts, I do:
>> imgtag: parse imgtag {"}
== ["IMG" "SRC=" "../something/someimage.jpg"] So I change imgtag/3 to something else, and I wish to rebuild the tag and reinsert it into the source code. However:
>> build-tag imgtag
== <IMG="SRC="="someimage.jpg"> So, uhh.. Seeing as how I'm such an ultranovice and all... now what? Or... let me guess... There's a better way, using parse, to extract the image's path (so I can append it to the URL for reading) and allow me to modify it without breaking the tag up so, right? :( 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. Right now I'm being excessively ugly:
>> imgtag: to-tag rejoin [imgtag/1 " " imgtag/2 {"} imgtag/3 {"}]
== <IMG SRC="someimage.jpg"> *sighs* I have a lot to learn... and that is why I'm doing this. *smirk* Thanks everyone. --Charles