Methods Summary |
---|
public void | display(int indent)Displays the contents of this element
indent(indent);
Util.println("Unsupported element = " + _qname.getNamespace() +
":" + _qname.getLocalPart());
displayContents(indent + IndentIncrement);
|
public void | parseContents(com.sun.org.apache.xalan.internal.xsltc.compiler.Parser parser)Find any fallback in the descendant nodes; then activate & parse it
processFallbacks(parser);
|
private void | processFallbacks(com.sun.org.apache.xalan.internal.xsltc.compiler.Parser parser)Scan and process all fallback children of the unsupported element.
Vector children = getContents();
if (children != null) {
final int count = children.size();
for (int i = 0; i < count; i++) {
SyntaxTreeNode child = (SyntaxTreeNode)children.elementAt(i);
if (child instanceof Fallback) {
Fallback fallback = (Fallback)child;
fallback.activate();
fallback.parseContents(parser);
if (_fallbacks == null) {
_fallbacks = new Vector();
}
_fallbacks.addElement(child);
}
}
}
|
public void | setErrorMessage(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg message)There are different categories of unsupported elements (believe it
or not): there are elements within the XSLT namespace (these would
be elements that are not yet implemented), there are extensions of
other XSLT processors and there are unrecognised extension elements
of this XSLT processor. The error message passed to this method
should describe the unsupported element itself and what category
the element belongs in.
_message = message;
|
public void | translate(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)Translate the fallback element (if any).
if (_fallbacks != null) {
int count = _fallbacks.size();
for (int i = 0; i < count; i++) {
Fallback fallback = (Fallback)_fallbacks.elementAt(i);
fallback.translate(classGen, methodGen);
}
}
// We only go into the else block in forward-compatibility mode, when
// the unsupported element has no fallback.
else {
// If the unsupported element does not have any fallback child, then
// at runtime, a runtime error should be raised when the unsupported
// element is instantiated. Otherwise, no error is thrown.
ConstantPoolGen cpg = classGen.getConstantPool();
InstructionList il = methodGen.getInstructionList();
final int unsupportedElem = cpg.addMethodref(BASIS_LIBRARY_CLASS, "unsupported_ElementF",
"(" + STRING_SIG + "Z)V");
il.append(new PUSH(cpg, getQName().toString()));
il.append(new PUSH(cpg, _isExtension));
il.append(new INVOKESTATIC(unsupportedElem));
}
|
public com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type | typeCheck(com.sun.org.apache.xalan.internal.xsltc.compiler.SymbolTable stable)Run type check on the fallback element (if any).
if (_fallbacks != null) {
int count = _fallbacks.size();
for (int i = 0; i < count; i++) {
Fallback fallback = (Fallback)_fallbacks.elementAt(i);
fallback.typeCheck(stable);
}
}
return Type.Void;
|