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 { AxisIterator kids = iterateAxis(Axis.CHILD); while(true) { NodeInfo curr = (NodeInfo)kids.next(); if (curr == null) { break; } if (curr instanceof XSLWhen) { if (otherwise!=null) { compileError("xsl:otherwise must come last", "XTSE0010"); } numberOfWhens++; } else if (curr instanceof XSLOtherwise) { if (otherwise!=null) { compileError("Only one xsl:otherwise allowed in an xsl:choose", "XTSE0010"); } else { otherwise = (StyleElement)curr; } } else { compileError("Only xsl:when and xsl:otherwise are allowed here", "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(); }
AxisIterator kids = iterateAxis(AxisInfo.CHILD); while (true) { NodeInfo curr = kids.next(); actions[w] = b; } catch (XPathException e) { compileError(e); if (getCompilation().getCompilerInfo().isCompileWithTracing()) { actions[w] = makeTraceInstruction((XSLWhen) curr, actions[w]); } else if (curr instanceof XSLOtherwise) { Expression otherwise = Literal.makeLiteral(BooleanValue.TRUE); otherwise.setRetainedStaticContext(makeRetainedStaticContext()); conditions[w] = otherwise; Expression b = ((XSLOtherwise) curr).compileSequenceConstructor(exec, decl, true); if (b == null) { b = Literal.makeEmptySequence(); b.setRetainedStaticContext(makeRetainedStaticContext()); actions[w] = b; } catch (XPathException e) { compileError(e); if (getCompilation().getCompilerInfo().isCompileWithTracing()) { actions[w] = makeTraceInstruction((XSLOtherwise) curr, actions[w]);
AxisIterator kids = iterateAxis(Axis.CHILD); while(true) { NodeInfo curr = (NodeInfo)kids.next(); b = makeExpressionVisitor().simplify(b); actions[w] = b; } catch (XPathException e) { compileError(e); if (getPreparedStylesheet().isCompileWithTracing()) { TraceWrapper trace = makeTraceInstruction((XSLWhen)curr, actions[w]); actions[w] = trace; b = makeExpressionVisitor().simplify(b); actions[w] = b; } catch (XPathException e) { compileError(e); if (getPreparedStylesheet().isCompileWithTracing()) { TraceWrapper trace = makeTraceInstruction((XSLOtherwise)curr, actions[w]); actions[w] = trace;
return new XSLCharacterMap(); case StandardNames.XSL_CHOOSE: return new XSLChoose(); case StandardNames.XSL_COMMENT: return new XSLComment();
/** * Mark tail-recursive calls on templates and functions. */ public boolean markTailCalls() { boolean found = false; AxisIterator kids = iterateAxis(AxisInfo.CHILD); while (true) { NodeInfo curr = kids.next(); if (curr == null) { return found; } if (curr instanceof StyleElement) { found |= ((StyleElement) curr).markTailCalls(); } } }
AxisIterator kids = iterateAxis(AxisInfo.CHILD); while (true) { NodeInfo curr = kids.next(); actions[w] = b; } catch (XPathException e) { compileError(e); if (getCompilation().getCompilerInfo().isCompileWithTracing()) { actions[w] = makeTraceInstruction((XSLWhen) curr, actions[w]); } else if (curr instanceof XSLOtherwise) { Expression otherwise = Literal.makeLiteral(BooleanValue.TRUE); otherwise.setRetainedStaticContext(makeRetainedStaticContext()); conditions[w] = otherwise; Expression b = ((XSLOtherwise) curr).compileSequenceConstructor(exec, decl, true); if (b == null) { b = Literal.makeEmptySequence(); b.setRetainedStaticContext(makeRetainedStaticContext()); actions[w] = b; } catch (XPathException e) { compileError(e); if (getCompilation().getCompilerInfo().isCompileWithTracing()) { actions[w] = makeTraceInstruction((XSLOtherwise) curr, actions[w]);
AxisIterator kids = iterateAxis(Axis.CHILD); while(true) { NodeInfo curr = (NodeInfo)kids.next(); b = makeExpressionVisitor().simplify(b); actions[w] = b; } catch (XPathException e) { compileError(e); if (getPreparedStylesheet().isCompileWithTracing()) { TraceWrapper trace = makeTraceInstruction((XSLWhen)curr, actions[w]); actions[w] = trace; b = makeExpressionVisitor().simplify(b); actions[w] = b; } catch (XPathException e) { compileError(e); if (getPreparedStylesheet().isCompileWithTracing()) { TraceWrapper trace = makeTraceInstruction((XSLOtherwise)curr, actions[w]); actions[w] = trace;
return new XSLCharacterMap(); case StandardNames.XSL_CHOOSE: return new XSLChoose(); case StandardNames.XSL_COMMENT: return new XSLComment();
/** * Mark tail-recursive calls on templates and functions. */ public void markTailCalls() { AxisIterator kids = iterateAxis(Axis.CHILD); while(true) { NodeInfo curr = (NodeInfo)kids.next(); if (curr == null) { return; } if (curr instanceof StyleElement) { ((StyleElement)curr).markTailCalls(); } } }
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(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"); } }
return new XSLCharacterMap(); case StandardNames.XSL_CHOOSE: return new XSLChoose(); case StandardNames.XSL_COMMENT: return new XSLComment();
/** * Mark tail-recursive calls on templates and functions. */ public boolean markTailCalls() { boolean found = false; AxisIterator kids = iterateAxis(AxisInfo.CHILD); while (true) { NodeInfo curr = kids.next(); if (curr == null) { return found; } if (curr instanceof StyleElement) { found |= ((StyleElement) curr).markTailCalls(); } } }
/** * 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++) { int nc = atts.getNameCode(a); checkUnknownAttribute(nc); } }
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"); } }
return new XSLCharacterMap(); case StandardNames.XSL_CHOOSE: return new XSLChoose(); case StandardNames.XSL_COMMENT: return new XSLComment();
/** * Mark tail-recursive calls on templates and functions. */ public boolean markTailCalls() { boolean found = false; AxisIterator kids = iterateAxis(Axis.CHILD); while(true) { NodeInfo curr = (NodeInfo)kids.next(); if (curr == null) { return found; } if (curr instanceof StyleElement) { found |= ((StyleElement)curr).markTailCalls(); } } }