After putting countless print statements, I finally found that for some
god uknown reason, string concatnation doesn't quite work in some cases.
In XPathScript.pm's translate_node(), there is a string concatnation
that takes place after _apply_templates() is called:
$middle .= interpolate($node, $trans->{prechild}) .
_apply_templates() .
interpolate($node, $trans->{postchild});
This concatnation seems to produce erronous results... I verified this
by replacing the concatenation with a sprintf, which worked:
$middle = sprintf( '%s%s%s%s',
$middle,
interpolate($node, $trans->{prechild}),
_apply_templates(),
interpolate($node, $trans->{postchild})
);
On this hint, I added a "use bytes" pragma in XPathScript.pm, which
fixed everything. I don't know why, but certain things seem to just flat
out fail on my machine when it comes to encoding. Case in point: I had a
problem earlier with Text::Template -- same type of thing, the
characters came out misaligned or something. But when I introduced a
"use bytes" on top of Text::Template, everything was peachy again.
Weird, eh? It could just be my machine, my perl... Mark Dominus couldn't
reproduce my problem, either.
Anyway I'm not really familiar with string internals and such, so I
don't even know *why* this works, but if it doesn't hurt AxKit it would
be kind of nice to have a mandatory "use bytes" in AxKit files... I
would think there may be some other potential victims out there who has
the same setup as I do.
Of course, I can just add it manually as I need too, so if not, no
biggie either.
--d
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]