Another problem is that 'string s;' or 'string s=0;' evaluate to 'int' when using %t and 'zero_type()' doesn't help either.

Not a problem for pike but for any other language using the generated XML.

As a workaround, have you considered using typeof()/_typeof() ?

----8<----8<----8<----
> string s; string t=0; string u=""; string v="foo";
> zero_type(s);
(1) Result: 0
> zero_type(t);
(2) Result: 0
> zero_type(u);
(3) Result: 0
> zero_type(v);
(4) Result: 0
> typeof(s);
(5) Result: string
> typeof(t);
(6) Result: string
> typeof(u);
(7) Result: string
> typeof(v);
(8) Result: string
> _typeof(s);
(9) Result: zero
> _typeof(t);
(10) Result: zero
> _typeof(u);
(11) Result: string
> _typeof(v);
(12) Result: string
---->8---->8---->8----


-- 
Bertrand LUPART
29, rue du Colisée - 75008 Paris
+33 1 72 71 71 84