Subject: Re: Aargh - wrong template applied
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Wed, 19 Apr 2006 02:45:36 +0200
|
Ian Eure wrote:
I want to pass through the document as-is in most cases, but make
certain changes elsewhere. I have a generic pass-through rule, and a
more specific rule to strip out <font> elements, but retain their
children. However, the latter template is never called, and I can't
figure out why.
>
I'm using XSLTProc. Turning on it's verbose mode gives me some relevant
information:
added pattern : '@*' priority -0.500000
added pattern : 'node()' priority -0.500000
added pattern : 'font' priority 0.000000
Looks good, but then:
xsltProcessOneNode: applying template '@*|node()' for font
Why isn't the latter template ever applied, and how do I get the
behavior I want?
This may be a bug in xsltproc. You can try some voodoo and move the
generic copy-through to the end of the style sheet. The order of
the templates should only matter if there is a tie in the priority
for matching patterns though. You could also try to assign a high
positive priority to the font matching template. In either case, I'd
ask on the relevant xsltproc specific list, maybe they have already
a proper solution.
J.Pietschmann
|