Rob Hunter wrote:
> I'm trying to avoid having
> 
> <textarea id="foo"></textarea>
> 
> turn into
> 
> <textarea />
> 
> But this is exactly what happens to me in both XmlSimple and REXML:
> 
> irb(main):028:0> print
> XmlSimple.xml_out(XmlSimple.xml_in("<opt><textarea id=\"foo\"></tex\
> tarea></opt>"))
> <opt>
>   <textarea id="foo" />
> </opt>
> 
> The problem is that
> 
> <textarea />
> 
> doesn't render in a browser.
> 
> Does anyone know of a way to avoid this in either library?  Or, should I
> be doing this another way?
> 
> Thanks,
> Rob

HTML is not an XML language, it is an SGML language. Use an HTML parser 
instead of an XML parser. For example Hpricot.

Regards
Stefan
-- 
Posted via http://www.ruby-forum.com/.