1 package net.sf.saxon.style; 2 import net.sf.saxon.expr.Expression; 3 import net.sf.saxon.instruct.Executable; 4 import net.sf.saxon.om.AttributeCollection; 5 import net.sf.saxon.trans.XPathException; 6 import net.sf.saxon.type.ItemType; 7 8 9 10 13 14 public class XSLOtherwise extends StyleElement { 15 16 21 22 protected ItemType getReturnedItemType() { 23 return getCommonChildItemType(); 24 } 25 26 public void prepareAttributes() throws XPathException { 27 AttributeCollection atts = getAttributeList(); 28 for (int a=0; a<atts.getLength(); a++) { 29 int nc = atts.getNameCode(a); 30 checkUnknownAttribute(nc); 31 } 32 } 33 34 38 39 public boolean mayContainSequenceConstructor() { 40 return true; 41 } 42 43 public void validate() throws XPathException { 44 if (!(getParent() instanceof XSLChoose)) { 45 compileError("xsl:otherwise must be immediately within xsl:choose", "XTSE0010"); 46 } 47 } 48 49 52 53 public void markTailCalls() { 54 StyleElement last = getLastChildInstruction(); 55 if (last != null) { 56 last.markTailCalls(); 57 } 58 } 59 60 public Expression compile(Executable exec) throws XPathException { 61 throw new UnsupportedOperationException ("XSLOtherwise#compile() should not be called"); 62 } 63 64 } 65 66 | Popular Tags |