Simon Krahnke wrote: > * Felix Windt <fwmailinglists / gmail.com> (22:18) schrieb: > >> I'm leaving off the opening bracket '<': >> >> line.gsub!(/registrantName>/, 'SUB.HEAD4>') >> >> So that it will match the opening as well as closing statement. > > As well as any substring "registrantName>". And well-formed XML won't > guarantee that only "<registrantName>" and "</registrantName>" will > contain that. > > gsub!(/(<\/?)registrantName>/, '\1SUB.HEAD4>') should do. > > But again, CDATA-sections and comments may well contain these strings. > I'd use XSLT or some SAX-Library if it has to be ruby. > > mfg, simon .... l Thank you, everyone. Yes, my XML is well-formed, but, it's also pretty simple, and, from what our vendor tells me, pretty consistent. I just need to convert it to SGML for our company publishing system. XSLT is probably better for this, I'm sure, but, it's enough for me just to learn Ruby. (-: Plus, I love Ruby. Thanks again. -- Posted via http://www.ruby-forum.com/.