|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: if a condition is not met
> Can someone, btw, elaborate on the following: Why is it that a statement > like current-group()[some-predicate]/following-sibling::* will return > *all* following sibling and not only the elements that are part of the > current group? because (as you guessed) current_group() returrns original nodes, not copies. this is just the same as in xslt1, <xsl:for-each select="a"> <xsl:copy-of select="following-sibling::*"/> following-sibling::* here would select all siblings of the current (a) node, the way that node was selected (in the for-each) is irrelevant. > To workaround this, I know that you can treat the current-group() > results as a document-node when you copy it into a variable and go from > there. copyig (might) be expensive, an alternative if you want to ensure that a path expression only returns elements in the current group is to go (pathexpression) intersect current-group() But if you are doing current-group()[some-predicate]/following-sibling::* then it looks like you are doing some further grouping on the current group so often it is more natural to do <xsl:for-each-group select="current-group()" group-starting-with="node()[some-predicate]"> ... Then it is automatically constrained to just work within the current group. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








