Re: [xsl] Simple template matching problem

Subject: Re: [xsl] Simple template matching problem
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 08 May 2007 01:08:25 +0200
Steve wrote:

What you need is: match="Records[Record]" (you need a predicate, not a child specification).

I suppose I thought that Record[DATA_TYPE='x'] would override Records/Record because it was more specific. Obviously my ideas about xsl's ability to pick templates border on prescient.

Templates are chosen based on precedence rules which are clearly defined. I don't know them by heart, but in general, I think the following suffices: the more specific you get, the higher the precedence, but extra predicates or parent/child specifications do not add up and count equally.


If you want to override the default precedence (using @priority), using something below 0 will always be lower than default precedence and something above 1 will always be higher than default precedence.


Not really sure what you mean here. Yes, this is a much abbreviated
snippet from the actual xsl. Why do I need what, exactly?

Sorry, 'this' referred to '//beginDate'. It looks to me like a point for improvement of your code, but I can't tell, because I know too little of your structure. Hence the (sorry, rather vague) description of why and all.


Switching modes is something really handy why you happen to have very similar data sets that have to be treated rather differently. It looks like you have such sources, but I can't tell from your input.

Cheers,
-- Abel

Current Thread