cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Josten <>
Subject Re: dynamic template matches
Date Tue, 04 Oct 2005 11:19:48 GMT
> What i meant was:
> <template match="*">
> 	<xsl:apply-templates select="xalan:evaluate($xpath)" mode="my-xpath-mode"/>
> </template>
> <template match="*" mode="my-xpath-mode">
> 	<choose>
> 		<!-- Or any other check -->
> 		<when test="contains($xpath,'sth')">
> 			Do sth with nodes when the xpath contains "sth"
> 		</when>
> 		<otherwise>
> 			Do sth else
> 		</otherwise>
> 	</choose>
> </template>

Ah, just one mode string. Ever used this approach? With the evaluate in it I mean?

> And the above example would match the xpath expression contained in
> $xpath doesn't it? (That was the Goal i thought.)

Though I'm not the problem owner (so don't ask me about the goal ;), i think this approach
apply-templates is useful in only limited situations. The original posted tried to test for
xpaths. That can be done with the apply-templates, somehow, I guess. But the one that suggested
generate an XSL had a different use case, in which most is copied and the xpath matching elements

were only marked. In that case apply-templates is not that useful...



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message