Hi Tres,
Not conclusive. The browser might be perfectly happy to strip off the trailing space. Try <dtml-var expr="_.len(mwid)"> to see for sure.
I tried really hard to reproducte the problem, thinking that perhaps Zope was mangling the extra space onto mwid's value when used inside the expr="" attribute, while not in the name= one. I think I have to conclude that Heer Linde's problem is an artifact of something besides the DTML machinery, as no combination of properties and subobjects seems to yield the same result.
Forget my previous reply. <dtml-var expr="_.len(mwid)"> did work, there was another problem. Forgive me (a bit to quick on send mail button). You were right. It's an artifact besides DTML. The len function always returns 20 as the lenght of mwid. I seem's to be a problem of MS SQL-server 7 or the ODBC DA. Regardless what the lenght of the content in a Varchar field is, SQL-server 7/ODBC DA alway seems to fill out the field with blancs to the max field width. So the 'ugly' workaround by Martijn seems necessary. Thanks, Henny van der Linde Leiden University