W3C home > Mailing lists > Public > public-i18n-its@w3.org > October to December 2006

Re: What is possible in XSLT patterns

From: Martin Duerst <duerst@it.aoyama.ac.jp>
Date: Wed, 13 Dec 2006 18:28:32 +0900
Message-Id: <6.0.0.20.2.20061213180622.094b7010@localhost>
To: Sebastian Rahtz <sebastian.rahtz@oucs.ox.ac.uk>
Cc: fsasaki@w3.org, Yves Savourel <yves@opentag.com>, public-i18n-its@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:12:48 GMT