Robert K. wrote:
2007/8/20, Peter B. [email protected]:
xmlfile.gsub!(/(.*)</purpose>/mi, ‘Purpose: \1’)
The data stays the same. The line isn’t converted.
Not sure whether that may be related but I’d use (.?) instead of
(.). Otherwise you will get just one replacement starting at the
first in your file and ending at the last .
Btw, are you doing some kind of XML to HTML translation? Then maybe
XSLT is for you.
Yes, this worked, using (.?) instead of (.). I’ve always been putting
that “?” at the end, before the closing “/.” And, it never seemed to
work properly. This is great. Thank you very much!
Yes, I am converting XML to SGML and, yes, I have had that suggestion
before, of using XSLT. I’m just learning Ruby now, though, so, I’m
somewhat hesitant to learn yet another scripting language. Although,
I’ve heard that it isn’t hard to learn. I’ll take a look when I have