From: Dmitri Borodaenko Date: 2004-11-11T19:31:06+09:00 Subject: Re: REXML error reporting (XHTML validation) On Thu, 11 Nov 2004 06:22:42 +0900, James Britt wrote: > >>I see that 'script' elements are deleted, as the yaml file makes no > >>mention of that element. > > Right, that was on purpose. > Ah, I see. I thought of this as the start of a general-purpose lib that > might then be used by some more specific application. Well, it is going to be general-purpose -- if someone is going to use it. As with Samizdat's RDF layer, I don't want to implement features that no-one needs, and since I'm the only one currently using it, I do only the stuff I need. > A suggestion (motivated by self-interest): arrange for the code to allow > all proper XHTML by default, with the option of passing in a set of > elements and/or attributes that are disallowed at validation time. (...) > This way, you need not keep editing the base yaml file when adjusting > what to sanitize. I don't see the point: the reason I've put it all into a YAML file is that it's easier to edit it there, rather than in your source code. Or, if you want to do it programmatically, all you have to do is: class Sanitize attr_reader :xhtml end ... Sanitize.instance.xhtml['_common'].delete('style') -- Dmitry Borodaenko