/** * Process the [xsl:]default-mode attribute if there is one * * @throws net.sf.saxon.trans.XPathException if the value is not a valid EQName, or the token #unnamed */ protected void processDefaultMode() throws XPathException { String ns = getURI().equals(NamespaceConstant.XSLT) ? "" : NamespaceConstant.XSLT; String v = getAttributeValue(ns, "default-mode"); if (v != null) { if (v.equals("#unnamed")) { defaultMode = Mode.UNNAMED_MODE_NAME; } else { defaultMode = makeQName(v); // should check that this is actually a mode on a template } } PrincipalStylesheetModule psm = compilation.getPrincipalStylesheetModule(); final StructuredQName checkedName = defaultMode; if (psm != null && psm.isDeclaredModes()) { // It will be null on the xsl:package element itself psm.addFixupAction(() -> { if (psm.getRuleManager().obtainMode(checkedName, false) == null) { XPathException err = new XPathException("Mode " + checkedName.getDisplayName() + " is not declared in an xsl:mode declaration", "XTSE3085"); err.setLocation(this); throw err; } }); } }
/** * Process the [xsl:]default-mode attribute if there is one * * @throws net.sf.saxon.trans.XPathException if the value is not a valid EQName, or the token #unnamed */ protected void processDefaultMode() throws XPathException { String ns = getURI().equals(NamespaceConstant.XSLT) ? "" : NamespaceConstant.XSLT; String v = getAttributeValue(ns, "default-mode"); if (v != null) { if (v.equals("#unnamed")) { defaultMode = Mode.UNNAMED_MODE_NAME; } else { defaultMode = makeQName(v); // should check that this is actually a mode on a template } } PrincipalStylesheetModule psm = compilation.getPrincipalStylesheetModule(); final StructuredQName checkedName = defaultMode; if (psm != null && psm.isDeclaredModes()) { // It will be null on the xsl:package element itself psm.addFixupAction(() -> { if (psm.getRuleManager().obtainMode(checkedName, false) == null) { XPathException err = new XPathException("Mode " + checkedName.getDisplayName() + " is not declared in an xsl:mode declaration", "XTSE3085"); err.setLocation(this); throw err; } }); } }
psm.addFixupAction(() -> { if (fc.getFunction() == null) { Component target = psm.getComponent(fc.getSymbolicName());
psm.addFixupAction(() -> { if (fc.getFunction() == null) { Component target = psm.getComponent(fc.getSymbolicName());