return true;
}
public void validate(Declaration decl) throws XPathException {
NodeInfo parent = getParent();
global = (parent instanceof XSLStylesheet);
if (!((parent instanceof StyleElement) && ((StyleElement)parent).mayContainParam(null))) {
compileError("xsl:param must be immediately within a template, function or stylesheet", "XTSE0010");
}
if (!global) {
AxisIterator preceding = iterateAxis(Axis.PRECEDING_SIBLING);
while (true) {
NodeInfo node = (NodeInfo)preceding.next();
if (node == null) {
break;
}
if (node instanceof XSLParam) {
if (this.getVariableQName().equals(((XSLParam)node).getVariableQName())) {
compileError("The name of the parameter is not unique", "XTSE0580");
}
} else if (node instanceof StyleElement) {
compileError("xsl:param must not be preceded by other instructions", "XTSE0010");
} else {
// it must be a text node; allow it if all whitespace
if (!Whitespace.isWhite(node.getStringValueCS())) {
compileError("xsl:param must not be preceded by text", "XTSE0010");
}
}
}