01: package net.sf.saxon.style;
02:
03: import net.sf.saxon.expr.Expression;
04: import net.sf.saxon.instruct.Executable;
05: import net.sf.saxon.trans.StaticError;
06: import net.sf.saxon.trans.XPathException;
07:
08: /**
09: * This element is a surrogate for an extension element (or indeed an xsl element)
10: * for which no implementation is available.
11: */
12:
13: public class AbsentExtensionElement extends StyleElement {
14:
15: public boolean isInstruction() {
16: return true;
17: }
18:
19: /**
20: * Determine whether this type of element is allowed to contain a template-body
21: */
22:
23: public boolean mayContainSequenceConstructor() {
24: return true;
25: }
26:
27: /**
28: * Process the attributes of this element and all its children
29: */
30:
31: public void processAllAttributes() throws XPathException {
32: if (isTopLevel() && forwardsCompatibleModeIsEnabled()) {
33: // do nothing
34: } else {
35: super .processAllAttributes();
36: }
37: }
38:
39: public void prepareAttributes() throws XPathException {
40: }
41:
42: /**
43: * Recursive walk through the stylesheet to validate all nodes
44: */
45:
46: public void validateSubtree() throws XPathException {
47: if (isTopLevel() && forwardsCompatibleModeIsEnabled()) {
48: // do nothing
49: } else {
50: super .validateSubtree();
51: }
52: }
53:
54: public void validate() throws XPathException {
55: }
56:
57: public Expression compile(Executable exec) throws XPathException {
58:
59: if (isTopLevel()) {
60: return null;
61: }
62:
63: // if there are fallback children, compile the code for the fallback elements
64:
65: if (validationError == null) {
66: validationError = new StaticError("Unknown instruction");
67: }
68: return fallbackProcessing(exec, this );
69: }
70: }
71:
72: //
73: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
74: // you may not use this file except in compliance with the License. You may obtain a copy of the
75: // License at http://www.mozilla.org/MPL/
76: //
77: // Software distributed under the License is distributed on an "AS IS" basis,
78: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
79: // See the License for the specific language governing rights and limitations under the License.
80: //
81: // The Original Code is: all this file.
82: //
83: // The Initial Developer of the Original Code is Michael H. Kay.
84: //
85: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
86: //
87: // Contributor(s):
88: // Portions marked "e.g." are from Edwin Glaser (edwin@pannenleiter.de)
89: //
|