[Kss-devel] [Plone-developers] BeautifulSoup usage in kss.core
Wichert Akkerman
wichert at wiggy.net
Thu Mar 20 11:52:36 CET 2008
Previously Balazs Ree wrote:
> On Thu, 20 Mar 2008 08:56:47 +0100, Wichert Akkerman wrote:
>
> > I became aware that kss.core uses BeautifulSoup. Looking at the code it
> > is used to transform any HTML and XML parameters added to a KSS command.
> > I'm not sure I like that behaviour: if I pass in XML I would expect that
> > to be outputed as-is without any changes. I'm fine with an exception
> > being raised if my XML is invalid, but it should never be transformed.
> > Likewise for HTML: BeautifulSoup may make changes to my html that I do
> > not want. I feel that KSS should trust people using its API to pass in
> > valid data. If people put garbage in you will always get garbage going
> > out as well, even if you use BeautifulSoup in an attempt to clean things
> > up.
>
> It seems you are in the same opinion with Jeroen. He raised this question
> in connection with the kss.base rewrite. As I just responded to his post,
> let me quote my full reply on this list as well.
>
> Besides what is in my reply, there were also several reasons why we ended
> up applying the current solution, it is a result of a long work, and it
> seems to work reasonably well in practice, with no complains so far.
>
> As you can see below I am not opposing the improvement of the currently
> applied method but I insist on dealing with it in a separate step from
> the kss.base porting.
Sure. I want to approach this from the other direction: any
transformation such as this has (un)expected side effects. I have never
seen this behaviour documented anywhere, so this can lead to lots of
painful debugging. So I woud like to see real world examples that are
best solved by doing such a transform at the KSS level. Personally I do
suspect there are none.
Wichert.
--
Wichert Akkerman <wichert at wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
More information about the Kss-devel
mailing list