Re: Re: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet?

Craeg K Strong <[email protected]> Thu, 29 Aug 2002 20:54:35 -0400
Newsgroups gmane.comp.web.zope.parsed-xml
Organization Ariel Partners LLC
Message-ID <[email protected]>
Karl Anderson wrote:
> Craeg K Strong <[email protected]> writes:
>>See comments embedded below:
>>Karl Anderson wrote:
>>So you could enter things like:
>>
>>foo
>>foo.index_html()
>>bar.getDOMObj().serialize("ascii")
> 
> no way - you want this to be configurable TTW, and you don't want to
> exec python code that can be gotten TTW, even if you think you're
> secure.  Let people use a python script if they need to do that.
> 
> I recommend accepting an optional method name, having to write a
> script skin to handle parameters isn't so bad for users.  It's just an
> organizational issue, really.

Oh yeah, security <grin>   So the enhancement is

a) have an optional method name that
b) defaults to __str__

> You did crib off of XSLTemplate, right? ;)

Oh crap.  I wish I had seen that.  I would most certainly
have cribbed.  No, I can honestly say that this was a case of
great minds thinking alike ;-)

In any event, XMLTransform.py was the easiest part.
The things that consumed many hours were

a) Coming up with the architecture: separating out CacheManager
and TransformerRegistry and how transformers could be organized
in a way that is policy neutral.  That is, a design that would
allow people to organize their XSLTs any way they wanted.

b) Porting to multiple XSLT libraries.  *Especially* supporting
URI resolution.  Every library has their own way of doing it,
and it seems to change all the time.  For example, between
0.11 and 0.12 the 4Suite URI resolver API changed radically.
(For the better)  In the end I only packaged up support for
libxslt, 4suite 11 and 4suite 12, although I tried out several
others...

> Looking at my old cruft, what I did was str(source) if no method name
> was given, which should work for ParsedXML.

Yep.  Seems like the right thing to do.

--Craeg