public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); for (int a = 0; a < atts.getLength(); a++) { checkUnknownAttribute(atts.getNodeName(a)); } }
public void validate(ComponentDeclaration decl) throws XPathException { if (!(getParent() instanceof XSLChoose)) { compileError("xsl:otherwise must be immediately within xsl:choose", "XTSE0010"); } }
/** * Mark tail-recursive calls on stylesheet functions. For most instructions, this does nothing. */ public boolean markTailCalls() { StyleElement last = getLastChildInstruction(); return last != null && last.markTailCalls(); }
return new XSLNamespaceAlias(); case StandardNames.XSL_OTHERWISE: return new XSLOtherwise(); case StandardNames.XSL_OUTPUT: return new XSLOutput();
} else if (curr instanceof XSLOtherwise) { conditions[w] = Literal.makeLiteral(BooleanValue.TRUE); Expression b = ((XSLOtherwise)curr).compileSequenceConstructor( exec, curr.iterateAxis(Axis.CHILD), true); if (b == null) {
public void validate(ComponentDeclaration decl) throws XPathException { AxisIterator kids = iterateAxis(AxisInfo.CHILD); while (true) { NodeInfo curr = kids.next(); if (curr == null) { break; } if (curr instanceof XSLWhen) { if (otherwise != null) { otherwise.compileError("xsl:otherwise must come last", "XTSE0010"); } numberOfWhens++; } else if (curr instanceof XSLOtherwise) { if (otherwise != null) { ((XSLOtherwise) curr).compileError("Only one xsl:otherwise is allowed in an xsl:choose", "XTSE0010"); } else { otherwise = (StyleElement) curr; } } else if (curr instanceof StyleElement) { ((StyleElement) curr).compileError("Only xsl:when and xsl:otherwise are allowed here", "XTSE0010"); } else { compileError("Only xsl:when and xsl:otherwise are allowed within xsl:choose", "XTSE0010"); } } if (numberOfWhens == 0) { compileError("xsl:choose must contain at least one xsl:when", "XTSE0010"); } }
/** * Determine the type of item returned by this instruction (only relevant if * it is an instruction). * @return the item type returned */ protected ItemType getReturnedItemType() { return getCommonChildItemType(); }
return new XSLNamespaceAlias(); case StandardNames.XSL_OTHERWISE: return new XSLOtherwise(); case StandardNames.XSL_OUTPUT: return new XSLOutput();
} else if (curr instanceof XSLOtherwise) { conditions[w] = Literal.makeLiteral(BooleanValue.TRUE); Expression b = ((XSLOtherwise)curr).compileSequenceConstructor( exec, curr.iterateAxis(Axis.CHILD), true); if (b == null) {
public void validate() throws XPathException { AxisIterator kids = iterateAxis(Axis.CHILD); while(true) { NodeInfo curr = (NodeInfo)kids.next(); if (curr == null) { break; } if (curr instanceof XSLWhen) { if (otherwise!=null) { otherwise.compileError("xsl:otherwise must come last", "XTSE0010"); } numberOfWhens++; } else if (curr instanceof XSLOtherwise) { if (otherwise!=null) { ((XSLOtherwise)curr).compileError("Only one xsl:otherwise is allowed in an xsl:choose", "XTSE0010"); } else { otherwise = (StyleElement)curr; } } else if (curr instanceof StyleElement) { ((StyleElement)curr).compileError("Only xsl:when and xsl:otherwise are allowed here", "XTSE0010"); } else { compileError("Only xsl:when and xsl:otherwise are allowed within xsl:choose", "XTSE0010"); } } if (numberOfWhens==0) { compileError("xsl:choose must contain at least one xsl:when", "XTSE0010"); } }
/** * Determine the type of item returned by this instruction (only relevant if * it is an instruction). * @return the item type returned */ protected ItemType getReturnedItemType() { return getCommonChildItemType(); }
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); for (int a = 0; a < atts.getLength(); a++) { checkUnknownAttribute(atts.getNodeName(a)); } }
public void validate() throws XPathException { if (!(getParent() instanceof XSLChoose)) { compileError("xsl:otherwise must be immediately within xsl:choose", "XTSE0010"); } }
return new XSLNamespaceAlias(); case StandardNames.XSL_OTHERWISE: return new XSLOtherwise(); case StandardNames.XSL_OUTPUT: return new XSLOutput();
/** * Mark tail-recursive calls on stylesheet functions. For most instructions, this does nothing. */ public boolean markTailCalls() { StyleElement last = getLastChildInstruction(); return last != null && last.markTailCalls(); }
otherwise.setRetainedStaticContext(makeRetainedStaticContext()); conditions[w] = otherwise; Expression b = ((XSLOtherwise) curr).compileSequenceConstructor(exec, decl, true); if (b == null) { b = Literal.makeEmptySequence();
public void validate(ComponentDeclaration decl) throws XPathException { AxisIterator kids = iterateAxis(AxisInfo.CHILD); while (true) { NodeInfo curr = kids.next(); if (curr == null) { break; } if (curr instanceof XSLWhen) { if (otherwise != null) { otherwise.compileError("xsl:otherwise must come last", "XTSE0010"); } numberOfWhens++; } else if (curr instanceof XSLOtherwise) { if (otherwise != null) { ((XSLOtherwise) curr).compileError("Only one xsl:otherwise is allowed in an xsl:choose", "XTSE0010"); } else { otherwise = (StyleElement) curr; } } else if (curr instanceof StyleElement) { ((StyleElement) curr).compileError("Only xsl:when and xsl:otherwise are allowed here", "XTSE0010"); } else { compileError("Only xsl:when and xsl:otherwise are allowed within xsl:choose", "XTSE0010"); } } if (numberOfWhens == 0) { compileError("xsl:choose must contain at least one xsl:when", "XTSE0010"); } }
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); for (int a=0; a<atts.getLength(); a++) { int nc = atts.getNameCode(a); checkUnknownAttribute(nc); } }
public void validate() throws XPathException { if (!(getParent() instanceof XSLChoose)) { compileError("xsl:otherwise must be immediately within xsl:choose", "XTSE0010"); } }
return new XSLOnNonEmpty(); case StandardNames.XSL_OTHERWISE: return new XSLOtherwise(); case StandardNames.XSL_OUTPUT: return new XSLOutput();