Jayadev, I can be wrong here, but it looks to me that you are trying to reason about XSLT in terms of a paradigm it doesn't belong to. "If we had something similar to a break of C language", then XSLT would be C.
XSLT is a functional language, C or
Java are not. You *can* re-state one concept (functional language) in terms of another (imperative language), and in Satya's case his variant probably maps to
for (i=1; ;i++ ) {
do something
if (i==someValue) break;
}
amd mine to
for (i=1; i != someValue ;i++ ) {
do something
}
But this is only syntactic sugar and it doesn’t provide too deep an insight into the semantics of the language.
This is from Raphael Finkel's "
Advanced Programming Language Design" (let the
word "advanced" scare nobody here, it isn't that much advanced
)
"Some languages are imperative; they use variables, assignments, and iteration. Other languages are functional; they have no variables, assignments, or iteration, but model program execution as expression evaluation."
Back to our break, one solution, "as originally described by Jeni Tennison, is not to use an xsl:for-each construct at all, but to replace it with a (recursively applied) template":
http://www.vbxml.com/code/default.asp?p=3&id=v20010228100123