| 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 | // Copyright (c) 2018 Saxonica Limited. |
| 3 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. |
| 4 | // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. |
| 6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 7 | |
| 8 | package net.sf.saxon.style; |
| 9 | |
| 10 | import net.sf.saxon.trans.XPathException; |
| 11 | import net.sf.saxon.type.ItemType; |
| 12 | |
| 13 | /** |
| 14 | * An xsl:merge-key element in the stylesheet. <br> |
| 15 | */ |
| 16 | |
| 17 | public class XSLMergeKey extends XSLSortOrMergeKey { |
| 18 | |
| 19 | |
| 20 | @Override |
| 21 | // protected boolean seesAvuncularVariables() { |
| 22 | // return false; |
| 23 | // } |
| 24 | |
| 25 | |
| 26 | public void prepareAttributes() throws XPathException { |
| 27 | |
| 28 | super.prepareAttributes(); |
| 29 | |
| 30 | if (stable != null) { |
| 31 | compileError("The @stable attribute is not allowed in xsl:merge-key", "XTSE0090"); |
| 32 | } |
| 33 | |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Bind a variable used in this element to the compiled form of the XSLVariable element in which it is |
| 38 | * declared |
| 39 | * |
| 40 | * @param qName The name of the variable |
| 41 | * @return the XSLVariableDeclaration (that is, an xsl:variable or xsl:param instruction) for the variable, |
| 42 | * or null if no declaration of the variable can be found |
| 43 | */ |
| 44 | |
| 45 | // public SourceBinding bindVariable(StructuredQName qName) { |
| 46 | // return ((StyleElement) this.getParent()).bindVariable(qName); |
| 47 | // } |
| 48 | |
| 49 | /** |
| 50 | * Determine the type of item returned by this instruction (only relevant if |
| 51 | * it is an instruction). Default implementation returns Type.ITEM, indicating |
| 52 | * that we don't know, it might be anything. Returns null in the case of an element |
| 53 | * such as xsl:sort or xsl:variable that can appear in a sequence constructor but |
| 54 | * contributes nothing to the result sequence. |
| 55 | * |
| 56 | * @return the item type returned |
| 57 | */ |
| 58 | |
| 59 | /*@Nullable*/ |
| 60 | protected ItemType getReturnedItemType() { |
| 61 | return null; |
| 62 | } |
| 63 | |
| 64 | protected String getErrorCode() { |
| 65 | return "XTSE3200"; |
| 66 | } |
| 67 | |
| 68 | |
| 69 | } |