Hi.
I've been trying to build an AxKit application over the past few weeks - and am having problems with XPathScript.
Everything else I do using layers of XSLT seems to work fine.
I basically have lots of interactions between elements that determine extra attributes for child elements.
This should be easier and cleaner to write in Perl than in XSLT.
My main problem is that I need to produce output for an element in between the start and end tags using $t->{element}{testcode}
e.g.
#$t->{D}{pre}='<D>';
#$t->{D}{post}='</D>';
$t->{D}{testcode} = sub {
my ($n,$t)[EMAIL PROTECTED];
print "<D>";
my $content=some_subroutine_call_that_adds_attributes_to_descendant_elements();
print "THIS IS MY CONTENT". $content;
apply_templates('*',$n);
some_subroutine_that_REMOVES_the_added_attributes();
print "</D>";
return 0;
}
For some reason it looks like all the print statements get output after the end of the apply_templates output;
i.e. - after my documents closing element.
(I am basing this conjecture on the error messages produced - as I can't even produce an intermediate document to examine using AxTraceIntermediate.)
I am not surprised by this - as I can't picture how apply_templates would work otherwise.
But the example on page 108 of Kip Hamptons AxKit book seems to imply that it should work OK.
When I can stick all the relevant output into $t->{pre}, and $t->{post} and return 1 - it again all seems to work OK.
But this doesn't let me process child nodes AFTER they have been output (and before something else searches them).
I.e. I would need $t->{D}{post} to actually be a subroutine.
Is there some basic 'gotcha' that I am missing?
Or is this too garbled - and some more concrete code would help?
Also - I cannot get expression interpolation to work. Wherever I put
PerlSetVar AxXPSInterpolate 1
I still get the un-interpolated text in my output.
Has anyone else had problems with this?
Any help would be appreciated
Thanks
Mike
-- Datalucid Limited
-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.2 - Release Date: 05/04/2005
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
