Debian Codegraph @

net/sf/saxon/style/XSLMatchingSubstring.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 /**
15 * Handler for xsl:matching-substring and xsl:non-matching-substring elements in stylesheet.
16 * New at XSLT 2.0<BR>
17 */
18
19 public class XSLMatchingSubstring extends StyleElement {
20
21
22 public void prepareAttributes() throws XPathException {
23 AttributeCollection atts = getAttributeList();
24 for (int a = 0; a < atts.getLength(); a++) {
25 checkUnknownAttribute(atts.getNodeName(a));
26 }
27 }
28
29 /**
30 * Determine whether this type of element is allowed to contain a template-body
31 *
32 * @return true: yes, it may contain a template-body
33 */
34
35 public boolean mayContainSequenceConstructor() {
36 return true;
37 }
38
39 public void validate(ComponentDeclaration decl) throws XPathException {
40 if (!(getParent() instanceof XSLAnalyzeString)) {
41 compileError(getDisplayName() + " must be immediately within xsl:analyze-string", "XTSE0010");
42 }
43 }
44
45 /*@NotNull*/
46 public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException {
47 throw new UnsupportedOperationException("XSLMatchingSubstring#compile() should not be called");
48 }
49
50 }
51