morten 01/10/18 04:59:04
Modified: java/src/org/apache/xalan/xsltc/compiler Parser.java
VariableBase.java
Log:
Changed the variable base class to allow variables to be re-defined in
a different scope.
PR: bugzilla 3268
Obtained from: n/a
Submitted by: [EMAIL PROTECTED]
Reviewed by: [EMAIL PROTECTED]
Revision Changes Path
1.28 +3 -3
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java
Index: Parser.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- Parser.java 2001/10/15 09:13:22 1.27
+++ Parser.java 2001/10/18 11:59:04 1.28
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Parser.java,v 1.27 2001/10/15 09:13:22 morten Exp $
+ * @(#)$Id: Parser.java,v 1.28 2001/10/18 11:59:04 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -198,8 +198,8 @@
_variableScope.remove(name);
}
- public SyntaxTreeNode lookupVariable(QName name) {
- return (SyntaxTreeNode)_variableScope.get(name);
+ public VariableBase lookupVariable(QName name) {
+ return((VariableBase)_variableScope.get(name));
}
public void setXSLTC(XSLTC xsltc) {
1.10 +3 -2
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableBase.java
Index: VariableBase.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableBase.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- VariableBase.java 2001/10/18 10:29:07 1.9
+++ VariableBase.java 2001/10/18 11:59:04 1.10
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: VariableBase.java,v 1.9 2001/10/18 10:29:07 morten Exp $
+ * @(#)$Id: VariableBase.java,v 1.10 2001/10/18 11:59:04 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -231,7 +231,8 @@
reportError(this, parser, ErrorMsg.NREQATTR_ERR, "name");
// Check whether variable/param of the same name is already in scope
- if (parser.lookupVariable(_name) != null) {
+ VariableBase other = parser.lookupVariable(_name);
+ if ((other != null) && (other.getParent() == getParent())) {
ErrorMsg msg = new ErrorMsg(ErrorMsg.VARREDEF_ERR, _name, this);
parser.reportError(Constants.ERROR, msg);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]