From: Hans Fugal Date: 2004-03-03T08:09:48+09:00 Subject: Re: REXML set default namespace > Does this do what you want? > > doc = Document.new(str) > doc[0].add_attributes("xmlns"=>"http://www.w3.org/1999/xhtml") > doc.to_s > #=> " href='http://google.com/'>Google" > > --Mark Thank you, that is a solution to my question. Now I've found I asked the wrong question :( Let me give more detail. I'm generating RSS with an xslt instruction like this: Now, given the following segment from the RSS: Google and the following segment from default.xsl: The output of xsltproc (which I use for testing) is what I would expect, "Google". But Mozilla's internal XSLT engine does not honor disable-output-escaping, resulting in the browser displaying the markup. The mozilla developers claim this is expected behavoir which they don't intend to 'fix'. The supposed solution[1] is to replace the xsl above with This doesn't work with the above example because the a tag gets a default namespace of "", hence my question. In tests if I put the namespace in the input data this solution works fine. In the case that I have a well-formed xml document as the sole content of the description tag (e.g. not mixed or only text) the solution you presented works, otherwise it doesn't. e.g. this would fail: This is a link to something as would this: Foo and this: foobar So as I see it there are two solutions: make the content of description well-formed xml, e.g. by wrapping the whole thing in a div, or adding a namespace or prefix to every element that is a child of description that does not already have a namespace/prefix. The latter is what I'd like to do, the former feels klugey. I can't figure out how to do the latter in REXML though. Any ideas? 1. http://home.clear.net.nz/pages/c.evans/proto/MoveableTypeXSLT/