From: Hans Fugal Date: 2004-03-03T06:04:43+09:00 Subject: REXML set default namespace str = 'Google' doc = Document.new(str) (desired incantation) doc.to_s desired output: Google More specifically in my situation I have a document (RSS) in one namespace and I want to do something like: str = 'foo
' description_el << Document.new(str) and get something like: foo or even foo
str is user-entered and for the application asking them to write their own xhtml is fine, but asking them to prepend the xhtml prefix to every element is silly. doc.namespace= doesn't work, which is the only thing I can divine as maybe being a sensible thing to do.