| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.style; |
| 9 |
|
| 10 |
import net.sf.saxon.expr.Expression; |
| 11 |
import net.sf.saxon.trans.XPathException; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
public class AbsentExtensionElement extends StyleElement { |
| 19 |
|
| 20 |
public boolean isInstruction() { |
| 21 |
return true; |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public boolean mayContainSequenceConstructor() { |
| 29 |
return true; |
| 30 |
} |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
public void processAllAttributes() throws XPathException { |
| 37 |
if (reportingCircumstances == IGNORED_INSTRUCTION) { |
| 38 |
return; |
| 39 |
} |
| 40 |
if (reportingCircumstances == REPORT_ALWAYS) { |
| 41 |
throw validationError; |
| 42 |
} |
| 43 |
if (isTopLevel() && forwardsCompatibleModeIsEnabled()) { |
| 44 |
|
| 45 |
} else { |
| 46 |
super.processAllAttributes(); |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
public void prepareAttributes() throws XPathException { |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
public void validateSubtree(ComponentDeclaration decl, boolean excludeStylesheet) throws XPathException { |
| 61 |
if (reportingCircumstances == IGNORED_INSTRUCTION || (isTopLevel() && forwardsCompatibleModeIsEnabled())) { |
| 62 |
|
| 63 |
} else { |
| 64 |
super.validateSubtree(decl, excludeStylesheet); |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
public void validate(ComponentDeclaration decl) throws XPathException { |
| 69 |
} |
| 70 |
|
| 71 |
|
| 72 |
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { |
| 73 |
|
| 74 |
if (isTopLevel() || reportingCircumstances == IGNORED_INSTRUCTION) { |
| 75 |
return null; |
| 76 |
} |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
if (validationError == null) { |
| 81 |
validationError = new XPathException("Unknown instruction"); |
| 82 |
} |
| 83 |
return fallbackProcessing(exec, decl, this); |
| 84 |
} |
| 85 |
} |
| 86 |
|