xsl-list
[Top] [All Lists]

Re: [xsl] Aargh - wrong template applied

2006-04-18 17:45:52
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--