Sorry to spam the list, but eventually I resolved the problem - for future readers I suggest updating the modules Pylons, Paste, PasteScript Kid and TurboKid to the latest versions.
For some reason PasteScript didn't want to update to 1.3 through easy_install -U so downloading the source and running "python setup.py install" and manually removing 1.1 did the trick. Ben was right in that format="xhtml" is the way to do it, but some combination of the different modules I had meant that did not work. I'm guessing it is related to my earlier install of TurboGears since some of the modules are shared, so I ended up with muddled versions. Cheers, Ben On May 14, 9:12 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > In addition to the above I changed middleware.py to have the > following: > > config.template_engines.pop()#remove myghty > kidopts = {'kid.outputformat':'xhtml','kid.assume_encoding':'utf-8', > 'kid.encoding':'utf-8'} > config.add_template_engine('kid', 'familiarsserver.templates', > kidopts) > > according to the example > athttp://pylonshq.com/docs/0.9.5/class-pylons.config.Config.html > > The 'kid.outputformat':'xhtml' is a turbogears option for TurboKid > which I see is the format Pylons also uses, so I presume it would be > passed on to Kid in the same way. > > However, this still has no effect. Even changing outputformat to xml > also has no effect. Is there something I'm still missing? Maybe I'm > using that outputformat option wrong? Or a poor configuration is > causing it to fall back on "html" as a default? > > I'm pretty lost here, but I think I'm closer, and also think it's > something in how the templating options are set up. > > Cheers again > Ben > > On May 14, 3:18 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Cheers for the suggestion but it doesn't seem to have any effect. > > > I realise I'm probably posting in the wrong group, but I'd rather let > > Pylons take care of Kid so any Pylons solution is going to be easier > > (rather than wrangling Kid directly and bypassing Pylons here). I'm > > confident it's probably me not configuring something correctly... > > > I've noticed that I get an error if Kid detects I've entered invalid > > XML in my template file. I presume that this validation process must > > be close to the bit that is doing the conversion. > > I input an invalid tag and get the following stack trace: > > > The function call is, as suggested, > > render_response(template,format="xhtml") > > >http://pylonshq.com/pasties/259 > > > To my inexperienced eyes it looks like from line 45 Kid is parsing my > > template and running the python code, so I presume it is somewhere > > around there that the conversion happens, but I can't see where. > > > For reference, my middleware.py uses this line to tell pylons to use > > Kid: > > config.init_app(global_conf, app_conf, package='myapplication', > > template_engine='kid') > > > I notice this line in environment.py: > > # The following template options are passed to your template engines > > tmpl_options = {} > > Adding 'format':'xhtml' doesn't make a difference here either. > > > There is nothing in development.ini that refers to Kid or templating > > options > > > Sorry again about posting this to the pylons group but I'm convinced > > there are some Pylons configuration options that might fix it if only > > I knew where to look :) > > > Cheers for patience, > > Ben > > > On May 1, 6:31 pm, Ben Bangert <[EMAIL PROTECTED]> wrote: > > > > On May 1, 2007, at 8:49 AM, [EMAIL PROTECTED] wrote: > > > > > All my kid templates work great, but they seem to be parsed through > > > > some kind of filter (pylons is using HTMLSerializer from Kid maybe?) > > > > that converts all my tags into HTML 4.01 versions: <title> becomes > > > > <TITLE> and <img src="blah" /> becomes <IMG SRC="blah"> > > > > > what is it that is doing this? Is there some way for me to switch it > > > > to spit outXHTML? or just to preferably leave my code as I wrote it? > > > > It worries me that the server is going through this extra conversion > > > > process for every page it renders. > > > > I believe this is Kid doing that. Pylons has no output filtering of > > > its own. You probably need to specify a default format for Kid of > > >xhtml(though I'm pretty certain that the Pylons Kid defaults already > > > set the format toxhtml...). > > > > Alternatively, you can specify format='xhtml' to render_response or > > > render which should be passed to Kid. > > > > HTH, > > > Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---