Re: What is possible in XSLT patterns

At 18:06 06/12/12, Sebastian Rahtz wrote:
>Martin Duerst wrote:
>> I agree, too. I also think that by using modes, one can avoid
>> the restrictions of patters.    
>I am not sure what you have in mind here? can you expand?
>
>sebastian

If you want a template to be selected with a particular,
complicated nodeset expression (whatever can go into a
apply-templates@select, http://www.w3.org/TR/xslt#element-apply-templates),
I think it should always work (except for namespace nodes) by
having
<xsl:apply-templates select="complicate expression" mode="unique value"/>
<xsl:template match="simplified pattern" mode="unique value">
  ...whatever
</xsl:template>

Here, "unique value" is an unique value, but the same in both cases.
"simplified pattern" is a simplification of the "complicated expression",
it can be a minimal pattern that makes sure that nothing from the
apply-templates is lost (it can be much broader than the
"complitaced expression"). The "unique value" of the mode makes
sure that only the selected nodes are being processed in the template.

At least that was the idea. I hope I got nothing wrong.

Regards,   Martin.


#-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-#  http://www.sw.it.aoyama.ac.jp       mailto:duerst@it.aoyama.ac.jp     

Received on Wednesday, 13 December 2006 10:03:18 UTC