Subject: Re: [xsl] Discrepancy in handling current() in a pattern From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 10 Jun 2009 17:26:04 -0700 |
here is what I am trying to do. ... <!-- First "stack" of matching for vertical lines --> <!-- This matches cells that have a vertical lines on their left -->
<xsl:template match="cell[@x != '1' and @z != ../cell[@y = current()/@y][@x= current()/@x - 1]/@z]" mode="cell" priority="2"> ... <!-- This matches cells that have a horizontal lines on their top -->
<xsl:template match="cell[@y!='1' and @z != ../cell[@y = current()/@y -1][@x= current()/@x]/@z]" mode="cell-2" priority="2">
So my questions: --------------- 1) Because of the discrepancy I noticed between Firefox and I.E, my first question is: "Is current() allowed or not in an XSLT1.0 pattern?" (or maybe it is "implementation defined or dependant" but XSLT1.0 is unclear about that... or I couldn't find it!)
2) Is is allowed in XSLT2.0 -should be because Saxon do not complain about current() itself, but about its type-, and what is the correct expression to remove the recoverable error?
"If the current function is used within a pattern, its value is the node that is being matched against the pattern."
/Although I would probably try to code this puzzle differently in 2.0, using for example a for-each-group/
3) Do you think of a better way to program this puzzle that should be compatible with both I.E. and Firefox, apart from doing a unique pattern with an ugly stack of 2 nested cases/otherwise.
-- XSLT/XSL-FO/XQuery hands-on training - Los Angeles, USA 2009-06-08 Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Discrepancy in handling curre, Alain | Thread | Re: [xsl] Discrepancy in handling c, Alain |
Re: [xsl] A smarter choose operatio, Karl Stubsjoen | Date | Re: [xsl] A smarter choose operatio, Dimitre Novatchev |
Month |