public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); String f = getNamePool().getClarkName(nc); if (f.equals(StandardNames.MODE)) { modeAttribute = Whitespace.trim(atts.getValue(a)); selectAtt = atts.getValue(a); } else { checkUnknownAttribute(nc); modeName = makeQName(modeAttribute); } catch (NamespaceException err) { compileError(err.getMessage(), "XTSE0280"); modeName = null; } catch (XPathException err) { compileError("Mode name " + Err.wrap(modeAttribute) + " is not a valid QName", "XTSE0280"); modeName = null; select = makeExpression(selectAtt);
public Expression compile(Executable exec) throws XPathException { SortKeyDefinition[] sortKeys = makeSortKeys(); if (sortKeys != null) { useTailRecursion = false; } Expression sortedSequence = select; if (sortKeys != null) { sortedSequence = new SortExpression(select, sortKeys); } compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); ApplyTemplates app = new ApplyTemplates( sortedSequence, useCurrentMode, useTailRecursion, mode, backwardsCompatibleModeIsEnabled(), implicitSelect); app.setActualParameters(getWithParamInstructions(exec, false, app), getWithParamInstructions(exec, true, app)); return app; }
public Expression compile(Compilation compilation, ComponentDeclaration decl) throws XPathException { SortKeyDefinitionList sortKeys = makeSortKeys(compilation, decl); if (sortKeys != null) { useTailRecursion = false; } assert select != null; Expression sortedSequence = select; if (sortKeys != null) { sortedSequence = new SortExpression(select, sortKeys); } compileSequenceConstructor(compilation, decl, true); RuleManager rm = compilation.getPrincipalStylesheetModule().getRuleManager(); ApplyTemplates app = new ApplyTemplates( sortedSequence, useCurrentMode, useTailRecursion, defaultedSelectExpression, isWithinDeclaredStreamableConstruct(), mode, rm); app.setActualParams(getWithParamInstructions(app, compilation, decl, false)); app.setTunnelParams(getWithParamInstructions(app, compilation, decl, true)); return app; }
if (iterateAxis(AxisInfo.ANCESTOR, new NameTest(Type.ELEMENT, StandardNames.XSL_TEMPLATE, getNamePool())).next() == null) { issueWarning("Specifying mode=\"#current\" when not inside an xsl:template serves no useful purpose", this); PrincipalStylesheetModule psm = getPrincipalStylesheetModule(); if (modeName == null) { modeName = getDefaultMode(); if ((modeName == null || modeName.equals(Mode.UNNAMED_MODE_NAME)) && psm.isDeclaredModes() && !psm.getRuleManager().isUnnamedModeExplicit()) { compileError("The unnamed mode must be explicitly declared in an xsl:mode declaration", "XTSE3085"); compileError("The #unnamed mode must be explicitly declared in an xsl:mode declaration", "XTSE3085"); compileError("Mode name " + modeName.getDisplayName() + " must be explicitly declared in an xsl:mode declaration", "XTSE3085"); AxisIterator kids = iterateAxis(AxisInfo.CHILD); NodeInfo child; while ((child = kids.next()) != null) { compileError("No character data is allowed within xsl:apply-templates", "XTSE0010"); compileError("Invalid element " + Err.wrap(child.getDisplayName(), Err.ELEMENT) + " within xsl:apply-templates", "XTSE0010"); select.setLocation(allocateLocation()); select.setRetainedStaticContext(makeRetainedStaticContext()); select = typeCheck("select", select);
mode = getPrincipalStylesheet().getRuleManager().getMode(modeName, true); AxisIterator kids = iterateAxis(Axis.CHILD); while (true) { NodeInfo child = (NodeInfo)kids.next(); compileError("No character data is allowed within xsl:apply-templates", "XTSE0010"); compileError("Invalid element within xsl:apply-templates", "XTSE0010"); select = typeCheck("select", select); try { RoleLocator role = select = TypeChecker.staticTypeCheck(select, SequenceType.NODE_SEQUENCE, false, role, makeExpressionVisitor()); } catch (XPathException err) { compileError(err);
return new XSLApplyImports(); case StandardNames.XSL_APPLY_TEMPLATES: return new XSLApplyTemplates(); case StandardNames.XSL_ATTRIBUTE: return new XSLAttribute();
if (iterateAxis(AxisInfo.ANCESTOR, new NameTest(Type.ELEMENT, StandardNames.XSL_TEMPLATE, getNamePool())).next() == null) { issueWarning("Specifying mode=\"#current\" when not inside an xsl:template serves no useful purpose", this); PrincipalStylesheetModule psm = getPrincipalStylesheetModule(); if (modeName == null) { modeName = getDefaultMode(); if ((modeName == null || modeName.equals(Mode.UNNAMED_MODE_NAME)) && psm.isDeclaredModes() && !psm.getRuleManager().isUnnamedModeExplicit()) { compileError("The unnamed mode must be explicitly declared in an xsl:mode declaration", "XTSE3085"); compileError("The #unnamed mode must be explicitly declared in an xsl:mode declaration", "XTSE3085"); compileError("Mode name " + modeName.getDisplayName() + " must be explicitly declared in an xsl:mode declaration", "XTSE3085"); AxisIterator kids = iterateAxis(AxisInfo.CHILD); NodeInfo child; while ((child = kids.next()) != null) { compileError("No character data is allowed within xsl:apply-templates", "XTSE0010"); compileError("Invalid element " + Err.wrap(child.getDisplayName(), Err.ELEMENT) + " within xsl:apply-templates", "XTSE0010"); select.setLocation(allocateLocation()); select.setRetainedStaticContext(makeRetainedStaticContext()); select = typeCheck("select", select);
mode = getPrincipalStylesheet().getRuleManager().getMode(modeName, true); AxisIterator kids = iterateAxis(Axis.CHILD); while (true) { NodeInfo child = (NodeInfo)kids.next(); compileError("No character data is allowed within xsl:apply-templates", "XTSE0010"); compileError("Invalid element within xsl:apply-templates", "XTSE0010"); select = typeCheck("select", select); try { RoleLocator role = select = TypeChecker.staticTypeCheck(select, SequenceType.NODE_SEQUENCE, false, role, makeExpressionVisitor()); } catch (XPathException err) { compileError(err);
public Expression compile(Compilation compilation, ComponentDeclaration decl) throws XPathException { SortKeyDefinitionList sortKeys = makeSortKeys(compilation, decl); if (sortKeys != null) { useTailRecursion = false; } assert select != null; Expression sortedSequence = select; if (sortKeys != null) { sortedSequence = new SortExpression(select, sortKeys); } compileSequenceConstructor(compilation, decl, true); RuleManager rm = compilation.getPrincipalStylesheetModule().getRuleManager(); ApplyTemplates app = new ApplyTemplates( sortedSequence, useCurrentMode, useTailRecursion, defaultedSelectExpression, isWithinDeclaredStreamableConstruct(), mode, rm); app.setActualParams(getWithParamInstructions(app, compilation, decl, false)); app.setTunnelParams(getWithParamInstructions(app, compilation, decl, true)); return app; }
return new XSLApplyImports(); case StandardNames.XSL_APPLY_TEMPLATES: return new XSLApplyTemplates(); case StandardNames.XSL_ATTRIBUTE: return new XSLAttribute();
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); String f = getNamePool().getClarkName(nc); if (f.equals(StandardNames.MODE)) { modeAttribute = Whitespace.trim(atts.getValue(a)); selectAtt = atts.getValue(a); } else { checkUnknownAttribute(nc); modeName = makeQName(modeAttribute); } catch (NamespaceException err) { compileError(err.getMessage(), "XTSE0280"); modeName = null; } catch (XPathException err) { compileError("Mode name " + Err.wrap(modeAttribute) + " is not a valid QName", err.getErrorCodeLocalPart()); modeName = null; select = makeExpression(selectAtt);
public Expression compile(Executable exec) throws XPathException { SortKeyDefinition[] sortKeys = makeSortKeys(); if (sortKeys != null) { useTailRecursion = false; } Expression sortedSequence = select; if (sortKeys != null) { sortedSequence = new SortExpression(select, sortKeys); } compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); ApplyTemplates app = new ApplyTemplates( sortedSequence, useCurrentMode, useTailRecursion, mode, backwardsCompatibleModeIsEnabled(), implicitSelect); app.setActualParameters(getWithParamInstructions(exec, false, app), getWithParamInstructions(exec, true, app)); return app; }
return new XSLApplyImports(); case StandardNames.XSL_APPLY_TEMPLATES: return new XSLApplyTemplates(); case StandardNames.XSL_ATTRIBUTE: return new XSLAttribute();
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); case "select": selectAtt = atts.getValue(a); select = makeExpression(selectAtt, a); defaultedSelectExpression = false; break; default: checkUnknownAttribute(atts.getNodeName(a)); break; default: try { modeName = makeQName(modeAttribute); } catch (XPathException err) { compileError("Mode name " + Err.wrap(modeAttribute) + " is not a valid QName", err.getErrorCodeQName()); modeName = null;
return new XSLApplyImports(); case StandardNames.XSL_APPLY_TEMPLATES: return new XSLApplyTemplates(); case StandardNames.XSL_ASSERT: return new XSLAssert();
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); case "select": selectAtt = atts.getValue(a); select = makeExpression(selectAtt, a); defaultedSelectExpression = false; break; default: checkUnknownAttribute(atts.getNodeName(a)); break; default: try { modeName = makeQName(modeAttribute); } catch (XPathException err) { compileError("Mode name " + Err.wrap(modeAttribute) + " is not a valid QName", err.getErrorCodeQName()); modeName = null;
return new XSLApplyImports(); case StandardNames.XSL_APPLY_TEMPLATES: return new XSLApplyTemplates(); case StandardNames.XSL_ASSERT: return new XSLAssert();