RE: [xsl] Applying templates to a mixed content node

Subject: RE: [xsl] Applying templates to a mixed content node
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Wed, 17 Sep 2003 11:05:32 -0400
[Ryan Graham]
> 
> >1) Why do you say it does not when it does?
> 
> The templates for <tabular> and its elements work together to 
> output an FO
> table (my initial testing shows that the FO is correct and I have
> successfully generated standalone tables with these templates 
> - this issue
> came up when I tried to integrate the table generation into my main
> stylesheet for formatting an entire book). The final FO file 
> doesn't contain
> any <fo:table> tags in it, nor is there any evidence of the 
> information
> contained in the <tabular> element or its children. 

This usually indicates one of two things.  First, not qualifying an
element name when it should be qualified (the testing might not have
used the namespace, and so might not have used qualified names).  This
seems unlikely here, since your testing produced FO outputs.

Second, the template may not be getting invoked because the context in
which it is applied is not what you think.  IOW, when you integrated
your test code into the larger stylesheet,   the processing is happening
differently from what you had in mind.  This possibility seems like the
most likely.

Although we cannot help without seeing more - but try to condense it to
the bare minimum that exhibits the problem, please! - you can find out
what the context is by inserting the following just ahead of the
template that is not producing any output -

<xsl:copy-of select='.'/>

This way you will see exactly what is being processed at that point.  If
this template is not called, then keep working your way backwards until
you find the last place processing is happening.  You do not need to use
the copy-of to find this place - just put some distinctive text in, like
'==========', so that you can find it right away in the output.

With these two techniques, you will be able to rapidly find out where
things are behaving differently from what you expect.  It will probably
be easier than using a debugger for this kind of situation, and you can
use them with any processor.  Anyway, however you do it, make sure that
the node(s) being processed at the point of interest is the one(s) you
had in mind.

Cheers,

Tom P


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread