| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.style; |
| 9 |
|
| 10 |
import net.sf.saxon.expr.Expression; |
| 11 |
import net.sf.saxon.trans.XPathException; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
public class XSLWhen extends StyleElement { |
| 20 |
|
| 21 |
private Expression test; |
| 22 |
|
| 23 |
public Expression getCondition() { |
| 24 |
return test; |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
public void prepareAttributes() throws XPathException { |
| 29 |
test = XSLIf.prepareTestAttribute(this); |
| 30 |
if (test == null) { |
| 31 |
reportAbsence("test"); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
public boolean mayContainSequenceConstructor() { |
| 42 |
return true; |
| 43 |
} |
| 44 |
|
| 45 |
public void validate(ComponentDeclaration decl) throws XPathException { |
| 46 |
if (!(getParent() instanceof XSLChoose)) { |
| 47 |
compileError("xsl:when must be immediately within xsl:choose", "XTSE0010"); |
| 48 |
} |
| 49 |
test = typeCheck("test", test); |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
public boolean markTailCalls() { |
| 57 |
StyleElement last = getLastChildInstruction(); |
| 58 |
return last != null && last.markTailCalls(); |
| 59 |
} |
| 60 |
|
| 61 |
|
| 62 |
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { |
| 63 |
return null; |
| 64 |
|
| 65 |
} |
| 66 |
|
| 67 |
} |