public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { if (select == null) { select = compileSequenceConstructor(exec, decl, true); } ((XSLTry) getParent()).addCatchClause(nameTest, select); return null; }
public void validate(ComponentDeclaration decl) throws XPathException { select = typeCheck("select", select); boolean foundCatch = false; AxisIterator kids = iterateAxis(AxisInfo.CHILD); NodeInfo kid; while ((kid = kids.next()) != null) { if (kid instanceof XSLCatch) { foundCatch = true; } else if (kid instanceof XSLFallback) { // no action; } else { if (foundCatch) { compileError("xsl:catch elements must come after all other children of xsl:try (excepting xsl:fallback)", "XTSE0010"); } if (select != null) { compileError("An " + getDisplayName() + " element with a select attribute must be empty", "XTSE3140"); } } } if (!foundCatch) { compileError("xsl:try must have at least one xsl:catch child element", "XTSE0010"); } }
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { Expression content = compileSequenceConstructor(exec, decl, true); if (select == null) { select = content; } TryCatch expr = new TryCatch(select); for (int i = 0; i < catchTests.size(); i++) { expr.addCatchExpression(catchTests.get(i), catchExprs.get(i)); } expr.setRollbackOutput(rollbackOutput); return expr; }
public void prepareAttributes() throws XPathException { String selectAtt = null; String rollbackOutputAtt = null; AttributeCollection atts = getAttributeList(); for (int a = 0; a < atts.getLength(); a++) { String f = atts.getNodeName(a).getDisplayName(); switch (f) { case "select": selectAtt = atts.getValue(a); select = makeExpression(selectAtt, a); break; case "rollback-output": rollbackOutputAtt = atts.getValue(a); break; default: checkUnknownAttribute(atts.getNodeName(a)); break; } } if (rollbackOutputAtt != null) { rollbackOutput = processBooleanAttribute("rollback-output", rollbackOutputAtt); } }
return topLevelModule ? new XSLPackage() : new XSLStylesheet(); case StandardNames.XSL_TRY: return new XSLTry(); case StandardNames.XSL_USE_PACKAGE: return new XSLUsePackage();
public void prepareAttributes() throws XPathException { String selectAtt = null; String rollbackOutputAtt = null; AttributeCollection atts = getAttributeList(); for (int a = 0; a < atts.getLength(); a++) { String f = atts.getNodeName(a).getDisplayName(); switch (f) { case "select": selectAtt = atts.getValue(a); select = makeExpression(selectAtt, a); break; case "rollback-output": rollbackOutputAtt = atts.getValue(a); break; default: checkUnknownAttribute(atts.getNodeName(a)); break; } } if (rollbackOutputAtt != null) { rollbackOutput = processBooleanAttribute("rollback-output", rollbackOutputAtt); } }
return topLevelModule ? new XSLPackage() : new XSLStylesheet(); case StandardNames.XSL_TRY: return new XSLTry(); case StandardNames.XSL_USE_PACKAGE: return new XSLUsePackage();
public void validate(ComponentDeclaration decl) throws XPathException { select = typeCheck("select", select); boolean foundCatch = false; AxisIterator kids = iterateAxis(AxisInfo.CHILD); NodeInfo kid; while ((kid = kids.next()) != null) { if (kid instanceof XSLCatch) { foundCatch = true; } else if (kid instanceof XSLFallback) { // no action; } else { if (foundCatch) { compileError("xsl:catch elements must come after all other children of xsl:try (excepting xsl:fallback)", "XTSE0010"); } if (select != null) { compileError("An " + getDisplayName() + " element with a select attribute must be empty", "XTSE3140"); } } } if (!foundCatch) { compileError("xsl:try must have at least one xsl:catch child element", "XTSE0010"); } }
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { if (select == null) { select = compileSequenceConstructor(exec, decl, true); } ((XSLTry) getParent()).addCatchClause(nameTest, select); return null; }
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { Expression content = compileSequenceConstructor(exec, decl, true); if (select == null) { select = content; } TryCatch expr = new TryCatch(select); for (int i = 0; i < catchTests.size(); i++) { expr.addCatchExpression(catchTests.get(i), catchExprs.get(i)); } expr.setRollbackOutput(rollbackOutput); return expr; }