Debian Codegraph @

net/sf/saxon/style/XSLMergeAction.java

raw symbols SCIP
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.expr.Expression;
11 import net.sf.saxon.om.AttributeCollection;
12 import net.sf.saxon.trans.XPathException;
13
14 public class XSLMergeAction extends StyleElement {
15
16 /**
17 * Determine whether this node is an instruction.
18 *
19 * @return true - it is an instruction
20 */
21
22 public boolean isInstruction() {
23 return false;
24 }
25
26 /**
27 * Determine whether this type of element is allowed to contain a sequence constructor
28 *
29 * @return true: yes, it may contain a sequence constructor
30 */
31
32 public boolean mayContainSequenceConstructor() {
33 return true;
34 }
35
36 @Override
37 public Expression compile(Compilation exec, ComponentDeclaration decl)
38 throws XPathException {
39 Expression content = compileSequenceConstructor(exec, decl, true);
40
41 return content;
42
43
44 }
45
46 @Override
47 protected void prepareAttributes() throws XPathException {
48 AttributeCollection atts = getAttributeList();
49
50 for (int a = 0; a < atts.getLength(); a++) {
51 checkUnknownAttribute(atts.getNodeName(a));
52 }
53
54 }
55
56 public void validate(ComponentDeclaration decl) throws XPathException {
57 if (!(getParent() instanceof XSLMerge)) {
58 compileError("xsl:merge-action may appear only as a child of xsl:merge", "XTSE0010");
59 }
60 }
61
62 }